Register
It is currently Fri Oct 24, 2014 8:41 am

find text cointain in folder name and execute a command


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Wed Feb 26, 2014 10:18 am   

Joined: Mon Nov 25, 2013 10:04 am
Posts: 9
this is my code but not work;

for subdir in */ ; do
foo=$(find -type d -name '*foo*')
if [[ $subdir =~ $foo ]] ; then
echo yes
ffmpeg -i mycode
else
echo no
fi
done


Top
 Profile  
 PostPosted: Thu Feb 27, 2014 4:11 am   
Moderator
User avatar

Joined: Thu Oct 11, 2007 7:12 am
Posts: 229
Location: London - UK
You're missing a path option to the find command.
"It does not work" does not help.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 8 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