Link to home
Start Free TrialLog in
Avatar of witty
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

Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

How about XYZ=`...|cut -f8- -d";"` ?
ASKER CERTIFIED SOLUTION
Avatar of mliberi
mliberi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mliberi
mliberi

you could also use the following syntax instead of using 'read'

XYZ="$(...|cut ...)"
Avatar of witty

ASKER

mliberi,

cool, this was exactly, what I needed!!!

Thank you VERY much
Michael