On 01/03/2012 10:16 AM, jida...@jidanni.org wrote:
> One can do
> $ read p
> to set $p
> but no just as easy method to set $@, $1, etc.
> One must do
> $ set -- `cat` #which involves ^D, "too much trouble"
> Or set -- `read x; echo "$x"` etc.

No need for a subshell to do what you want.  Just do:

read p
set -- "$p"

to set $1, or

read p
set -- $p

to set all of $@ according to the IFS splitting of $p.

> 
> So I propose we 'wreck the language' to allow me to do
> $ read @
> to set $@, same with 1, 2,.. * (almost the same as @).

Sorry, I don't think this is worth doing.

-- 
Eric Blake   ebl...@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to