Bash/Zsh brace expansion; Re: [plug] clone files - increment name

Mark O'Shea mark at musicalstoat.co.uk
Mon Sep 1 20:05:44 WST 2008


On Mon, Sep 01, 2008 at 12:30:10PM +0800, Alastair Irvine wrote:
> 
> 	> cat /etc/debian_version
> 	3.1
> 	> bash -c 'for i in {1..10} ; do echo $i ; done'
> 	{1..10}
> 
> As mentioned by Daniel Pittman in a later reply, this isn't 
> supported at all by shells other Bash and Zsh.  (pdKSH anyone?)

pdksh, ksh on solaris or *bsd, old style bourne shell, dash etc:
for i in `seq 1 10` ; do echo $i ;done

Also it works on bash.  Bashisms would be nice if they worked elsewhere
but then they wouldn't be bashisms.  They're almost as bad as using c
shell...

Mark



More information about the plug mailing list