Hey everyone!
Simple question - I am trying to use sed to replace two different strings. As it stands I can implement this as:
sed -i 's/TIMEOUT//g'
sed -i 's/null//g'
And it works. However, is it possible to shrink that down into a single command? Will there be any performance benefits?
[ctsgnb@shell ~]$ echo '|||' | sed 's/||/|,|/g' <----- in spite of the global replacement flag, it cannot handle 2 substitution in this odd series of pipe !
|,||
[ctsgnb@shell ~]$ echo '||||' | sed 's/||/|,|/g'
|,||,|
[ctsgnb@shell ~]$ echo '|||' | sed 's/||/|,|/g;s/||/|,|/g'
|,|,|
[ctsgnb@shell ~]$ echo '||||' | sed 's/||/|,|/g;s/||/|,|/g'
|,|,|,|
[ctsgnb@shell ~]$ uname -a
FreeBSD <anonymized> 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Sun Jul 25 16:41:25 MDT 2010 <anonymized> amd64
[ctsgnb@shell ~]$