On Thursday 15 May 2008 21:03, David C. Rankin wrote:
...
Thanks to all that replied. Where I got the "bash list" from was the mkdir -p that used a similar "list" to create multiple sub directories in one command like:
mkdir -pv Documents/{accounting,research/{legal,factual},reference}
The two key differences are the absence of white-space inside the curly-brace construct and the use of commas to separate the elements within.
23:02 trinity~/tmp> mkdir -pv Documents/{accounting,research/{legal,factual},reference} mkdir: created directory `Documents' mkdir: created directory `Documents/accounting' mkdir: created directory `Documents/research' mkdir: created directory `Documents/research/legal' mkdir: created directory `Documents/research/factual' mkdir: created directory `Documents/reference'
It came from one of the bash tips&tricks sites I ran across. I'll admit, I couldn't find a reference to it in either man bash or the info doc.
View the BASH man page and search for "Brace expansion". There's a whole section (seven paragraphs). CS Theory Section: Replace the braces with parentheses and the commas with vertical bars and you have a regular expression that will match all and only those strings that the brace expression generates.
-- David C. Rankin
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org