Hello all,
this list is great!!! Thanks to all who answered - there were many (!!)
answers in a short time.
Solution: echo "$text" instead of echo $text
Another short demo:
Switch1> x='A B'
Switch1> echo $x
A B
Switch1> echo "$x"
A B
regards
Werner Rost
------------------------------------------------------------------------
Hello gurus,
I guess this is a trivial question for all of you - except me .:)
In a test string I want to substitute the character "x" by blanks:
#!/usr/bin/ksh
#
text="P1A2 127558xxxxxxMMJJ1x750xxxxxxxxxx000x 024"
echo $text
text=`echo $text | /usr/bin/sed 's/x/ /g'`
echo $text
This leads to:
P1A2 127558xxxxxxMMJJ1x750xxxxxxxxxx000x 024
P1A2 127558 MMJJ1 750 000 024
Unfortunatly I miss many blanks. Output should read:
P1A2 127558xxxxxxMMJJ1x750xxxxxxxxxx000x 024
P1A2 127558 MMJJ1 750 000 024
What is going wrong?
regards
Werner Rost
--------------------------------------------------
Werner Rost, Mannesmann-Boge GmbH
Abt: KIR
Tel: 0228/3825-420
Fax: 0228/3825-398
Email: werner.rost_at_boge.mannesmann.de
Friesdorfer Str. 175, 53175 Bonn - Bad Godesberg
---------------------------------------------------
-----------------------------------------------------------
This Mail has been checked for Viruses
Attention: Encrypted Mails can NOT be checked !
***
Diese Mail wurde auf Viren ueberprueft
Hinweis: Verschluesselte Mails koennen NICHT geprueft werden!
------------------------------------------------------------
Received on Wed Mar 14 2001 - 16:29:19 NZDT