witty
asked on
get leading spaces into EnvVar
Hi!
this all in ksh!!!
think of something like
...|cut -f8- -d";"
now I want something like
...|cut -f8- -d";"|read XYZ
echo "$XYZ"
The problem is, that leading spaces are ignored by "read"!
What read does wrong, export does right!
export XYZ=" 123"
echo "$XYZ"
123
So I want to pipe into export!
How can I solve this??
Thanks
Witty
this all in ksh!!!
think of something like
...|cut -f8- -d";"
now I want something like
...|cut -f8- -d";"|read XYZ
echo "$XYZ"
The problem is, that leading spaces are ignored by "read"!
What read does wrong, export does right!
export XYZ=" 123"
echo "$XYZ"
123
So I want to pipe into export!
How can I solve this??
Thanks
Witty
How about XYZ=`...|cut -f8- -d";"` ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you could also use the following syntax instead of using 'read'
XYZ="$(...|cut ...)"
XYZ="$(...|cut ...)"
ASKER
mliberi,
cool, this was exactly, what I needed!!!
Thank you VERY much
Michael
cool, this was exactly, what I needed!!!
Thank you VERY much
Michael