LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 05-31-2007, 05:26 PM   #1
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,589

Rep: Reputation: 161Reputation: 161
How do I make a command accept regular expressions


How can I give mkdir the expression [a-z] and have it make 26 directories, a-z?
 
Old 05-31-2007, 06:10 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Hi.

Code:
for go in {a..z}
    do
    mkdir "$go"
done
That stumped me for a minute too. Had to look it up in the bash man page.

Dave
 
Old 05-31-2007, 10:20 PM   #3
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,695
Blog Entries: 5

Rep: Reputation: 239Reputation: 239Reputation: 239
Code:
mkdir -p {a..z}
 
Old 06-01-2007, 09:09 AM   #4
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,589

Original Poster
Rep: Reputation: 161Reputation: 161
Thank you both.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular expressions bhuwan Programming 5 02-25-2006 11:07 PM
Regular Expressions overbored Linux - Software 3 06-24-2004 02:34 PM
App install will not accept ./configure or Make command kwunderlich Linux - Newbie 3 01-02-2004 09:44 AM
Hping install will not accept the Make command kwunderlich Linux - Software 0 12-31-2003 11:15 AM
regular expressions? alaios Linux - General 2 06-11-2003 03:51 PM


All times are GMT -5. The time now is 11:16 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration