-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
MJ Ray mjr@phonecoop.coop wrote:
Brett Parker iDunno@sommitrealweird.co.uk wrote:
No, you can not do: cp dcp_`seq 1156 1183`.jpg dest And here's why... the arguments to cp will expand to: dcp_1156 1157 ... 1183.jpg
Actually, if you use the rc shell, you can do exactly that: cp dcp_^`{seq 1156 1183}^.jpg dest The `{} expands to a list, which then has the endings added associatively to produce dcp_1156.jpg dcp_1157.jpg and so on.
Hmm, useful. Sortof. Though, other than you, dear Mark, who else is running the rc shell? I'd make an assumption that most people are using bash, or some derivitive of sh. If they're using tcsh on a modern *nix operating system, they probably want shooting... I haven't tested in zsh yet, but I'm fairly sure my solutions would work in that too ;)
Unfortunately, bash just turns the output of backticks into a string and pastes it into the command. It then reads the next command in from that, which causes problems in this and other situations, instead of doing what you usually want.
Well, no, it wouldn't because I'm very very used to how bash expands things ;)
Cheers, - -- Brett Parker web: http://www.sommitrealweird.co.uk/ email: iDunno@sommitrealweird.co.uk