bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: let's set the positional parameters with a simple 'read'


From: Stephane CHAZELAS
Subject: Re: let's set the positional parameters with a simple 'read'
Date: Tue, 3 Jan 2012 21:04:30 +0000 (UTC)
User-agent: slrn/pre1.0.0-18 (Linux)

2012-01-04, 01:46(+08), address@hidden:
>>>>>> "GW" == Greg Wooledge <address@hidden> writes:
>GW> Why not just use a named array?
>GW> $ read -a myarray
> But does that let me get a my favorite array, the positional parameters?

FWIW, in zsh:

~$ read -A argv
a b c
~$ echo $1
a
~$ read 1
x
~$ echo $1
x

See also

vared argv
and
vared 1

to edit them with the zsh line editor (zle, the bash equivalent
would be readline as invoked by read -e)

-- 
Stephane




reply via email to

[Prev in Thread] Current Thread [Next in Thread]