Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help with Bash scriting

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
NewToBash



Joined: Tue Nov 29, 2005 11:24 pm
Posts: 1

PostPosted: Tue Nov 29, 2005 11:30 pm    Post subject: Need help with Bash scriting Reply with quote

Hello,

I'm a newbie to Bash. If someone could help me out with this it will be great.

I need to write a script to be able to go through all the directories (contained in home directory) ,names starting with "ms" and for each of such directories found create a new directory inside with the name "msdir"

Also please someone suggest a good website with lots of basic Bash scripts to help me learn how to program.

Thanks
Back to top
View user's profile Send private message
RD
LXF regular


Joined: Mon Jul 25, 2005 3:53 am
Posts: 272
Location: irc.ixl2.net

PostPosted: Wed Nov 30, 2005 12:11 am    Post subject: RE: Need help with Bash scriting Reply with quote

>> Also please someone suggest a good website with lots of basic Bash scripts to help me learn how to program.

Here is the best one i ever used infact its the best one most coders have used enjoy Very Happy
_________________
[url=irc://irc.ixl2.org/ixl2]irc.ixl2.org[/url]
Back to top
View user's profile Send private message Visit poster's website
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8449
Location: Warrington, UK

PostPosted: Wed Nov 30, 2005 12:40 am    Post subject: RE: Need help with Bash scriting Reply with quote

You don't need a bash script, just the find command
Code:
find ~ -type d -name 'ms*' -exec mkdir -p {}/msdir ';'


See man find for more details.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast