Re: chmod -R +x for directories only
- From: Bruce Stephens <bruce+usenet@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 17:33:30 +0100
"Chris F.A. Johnson" <cfajohnson@xxxxxxxxx> writes:
[...]
> Yes, it creates an array:
>
> $ a=("a b c" b c)
> $ printf "%s\n" "${a[@]}"
> a b c
> b
> c
Yes, my fault. I was confused because
$ echo $a
a b c
But in bash if I want all the elements, it appears I need to use
${a[*]}. But that expands a bit literally:
$ for i in ${a[*]}; do echo $i; done
a
b
c
d
e
So I need to use
$ for i in "${a[@]}"; do echo $i; done
a b c
d
e
I guess all this is consistent with the hacks one has to use with
POSIX shells ("$@" and the like). Personally I think the zsh people
have done the right thing: introduced minor incompatibility for (IMHO)
more sane behaviour. In zsh:
$ a=("a b c" d e)
$ echo $#a
3
$ for i in $a; echo $i
a b c
d
e
$ for i in $=a; echo $i
a
b
c
d
e
However, each to their own.
[...]
.
- References:
- chmod -R +x for directories only
- From: billy
- Re: chmod -R +x for directories only
- From: billy
- Re: chmod -R +x for directories only
- From: Keith Matthews
- Re: chmod -R +x for directories only
- From: Buzzbomb
- Re: chmod -R +x for directories only
- From: Bruce Stephens
- Re: chmod -R +x for directories only
- From: usenet
- Re: chmod -R +x for directories only
- From: Bruce Stephens
- Re: chmod -R +x for directories only
- From: Chris F.A. Johnson
- Re: chmod -R +x for directories only
- From: Bruce Stephens
- Re: chmod -R +x for directories only
- From: Chris F.A. Johnson
- chmod -R +x for directories only
- Prev by Date: Xterms and the meta key
- Next by Date: Re: Scottish Power website
- Previous by thread: Re: chmod -R +x for directories only
- Next by thread: Re: chmod -R +x for directories only
- Index(es):
Relevant Pages
|