From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <98458732715169.tru64-unix-managers.marc@archive.invalid> From: "Rost, Werner" Date: Wed, 14 Mar 2001 16:24:28 +0000 To: tru64-unix-managers Subject: SUMMARY: How to substitute with sed X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=98458732715169 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@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! ------------------------------------------------------------