Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DC$
uname output: Linux buildserver 2.6.27-11-server #1 SMP
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA
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, nothing as easy as
$ read 1
sds
bash: read: `1': not a valid identifier
$ read @
sdss
bash: read: `@': not a valid i
On 01/03/2012 06:48 AM, nick humphrey wrote:
> Description:
> i dont know if the bug is a bash bug or openssl or echo, but when i
> echo a string and pipe it to openssl, the
> output comes on the same line as the prompt instead of a new line.
None of the above. It's not a bug. Your encod
On Wed, Jan 04, 2012 at 01:16:27AM +0800, jida...@jidanni.org wrote:
> So I propose we 'wreck the language' to allow me to do
> $ read @
> to set $@, same with 1, 2,.. * (almost the same as @).
Why not just use a named array?
$ read -a myarray
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:
On Tue, Jan 3, 2012 at 7:16 PM, wrote:
...
> So I propose we 'wreck the language' to allow me to do
> $ read @
> to set $@, same with 1, 2,.. * (almost the same as @).
>
Since you can use "read -a arr" to set arr[1] arr[2] ...etc it's not
that interesting
Setting the positional parameters is rea
On Tuesday 03 January 2012 08:48:27 nick humphrey wrote:
> Description:
> i dont know if the bug is a bash bug or openssl or echo, but when i
> echo a string and pipe it to openssl, the
> output comes on the same line as the prompt instead of a new line. it makes
> the output hard to read b
> "GW" == Greg Wooledge 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?
On 01/03/2012 10:46 AM, jida...@jidanni.org wrote:
>> "GW" == Greg Wooledge 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?
Any time you want to assign the positional parameters, use set. It's as
2012-01-04, 01:46(+08), jida...@jidanni.org:
>> "GW" == Greg Wooledge 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
thanks eric and mike for your quick reply and suggestions =)
2012/1/3 Eric Blake
> On 01/03/2012 06:48 AM, nick humphrey wrote:
> > Description:
> > i dont know if the bug is a bash bug or openssl or echo, but
> when i
> > echo a string and pipe it to openssl, the
> > output comes on the
Hmmm, as S. CHAZELAS said seems zsh also gives one a chance to reset an
arbitrary positional parameter, e.g., the 42nd, whereas in bash one must
set them all at once:
$ set `seq 55`
$ echo $42
42
$ echo $66
66
:-)
Anyway isn't it rather old fashioned not to be able to somehow reset
${42} without ne
13 matches
Mail list logo