bug-bash
[Top][All Lists]
Advanced

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

Variables in compound command - value not retained


From: Ivaylo Stratkov (LCL)
Subject: Variables in compound command - value not retained
Date: Fri, 2 Jan 2004 13:55:20 -0500

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linu
x-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DSHELL -D
HAVE_CONFIG_H  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./li
b -I/usr/include -O2 -march=i386 -mcpu=i686
uname output: Linux lcllxdv16.ngco.com 2.4.9-e.27smp #1 SMP Tue Aug 5 15:49:54 E
DT 2003 i686 unknown
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.05
Patch Level: 8
Release Status: release

Description:
        Hi,
I'm trying to do variable assignment by piped commands, but the variable value i
s not assigned:
address@hidden istratk]$  echo 1 | read var
address@hidden istratk]$ echo var=$var
var=
I would expect the value of "var" to be 1, but it is not assigned,
If this is expected behavour... sorry for trouble.

Repeat-By:
Execute commands:
echo "Value" | read variable
echo $variable

Regards:
Ivaylo Stratkov
istratk at ngco dot com






reply via email to

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