tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "Rost, Werner" <Werner.Rost () boge ! mannesmann ! de>
To: tru64-unix-managers
Subject: SUMMARY: How to substitute with sed
Date: Wed, 14 Mar 2001 16:24:28 +0000	[thread overview]
Message-ID: <98458732715169.tru64-unix-managers.marc@archive.invalid> (raw)

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!
------------------------------------------------------------

                 reply	other threads:[~2001-03-14 16:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox