On Wednesday 14 May 2008 09:48, David C. Rankin wrote:
Listmates,
I am trying to use a bash list to move a group of files and directories under a single directory. It works, but I get a bash error I want to eliminate. How do I do it right so I can eliminate the error? Here is the situation. I want to move the following files and directories except "server" under the "desktop" directory with a single command:
...
I used this command line:
[11:38 nirvana/home/samba/computer/linux/apps] # mv { c* k* K* p* sim-0.9.4.3.tar.bz2 trix-0.93.tar.bz2 xca-0.6.4.tar.gz } desktop/
It's not entirely clear what you want, but if it's the argument synthesizing syntax, you're using it incorrectly. Try this: % echo left-{mid1,mid2,mid3}-right left-mid1-right left-mid2-right left-mid3-right If you're looking for the block construct, it must surround whole commands, not arguments: % { echo 1; echo 2; echo 3; } 1 2 3 (Note that the final semicolon is required unless you put the close brace on a new line.) If you're using the older globs, it would be more like this: % ls [ckKp]*
It all worked, but I got this error:
mv: cannot stat `{': No such file or directory mv: cannot stat `}': No such file or directory
Which makes sense because I didn't want the braces as directories only as list enclosures. How do I do it so I can eliminate the brace error?
"List enclosures?" BASH array variables are established like this: % listVar=( element1 element2 element3 ) % echo "${listVar[@]}" element1 element2 element3
-- David C. Rankin
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org