Register
It is currently Mon Sep 01, 2014 12:32 pm

find command`s -exec not working it seems.


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Mon Aug 22, 2011 4:36 pm   

Joined: Mon Aug 22, 2011 3:58 pm
Posts: 2
I want to replace the files in /lib with links pointing to the same files in a mounted Squash file.
I have a for loop that does this, but it seems that find should do it without the loop.
This is the command:
Code:
find /lib -type f -exec ln -s /mnt/sq/{} {} ;

I made this command to test it:
Code:
find /lib -type f -exec echo /mnt/sq/{} {} ;

It should show the arguments to "ln -s".
But I get the error... find: missing argument to `-exec'
I tried escaping the {} like this: \{} and this: \{\} , but no go.

NOTE: I wanted to replace the whole /lib dir. with a link, but "ln -s" won`t do it.
I renamed /lib to /lib_ and make a link to it /lib -> /lib_
Then when the Squash file`s mounted a new link can be made over the top of the old one.
But it doesn`t work, the /lib link still points to /lib_, and "ln -s" error code is 0 !!! ( no error...)


Top
 Profile  
 PostPosted: Tue Aug 23, 2011 1:42 am   
User avatar

Joined: Sat Jul 02, 2011 10:43 am
Posts: 23
Location: Devon,UK
the semi-colon at the end has to be escaped ( \; )


Top
 Profile WWW  
 PostPosted: Tue Aug 23, 2011 2:20 am   

Joined: Mon Aug 22, 2011 3:58 pm
Posts: 2
Thanks Keith; The ; needs to be kept from Bash interpreting it as a command separator. Of course...


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP