Hi,
Iam new to shell script.How to write bourn shell script for find and replace.
My requirement is:
variable:
name="abcd & co"
i wanted to replace '&' with amp; plz suggest with out using sed.
Thanks lot.
Hi,
Iam new to shell script.How to write bourn shell script for find and replace.
My requirement is:
variable:
name="abcd & co"
i wanted to replace '&' with amp; plz suggest with out using sed.
Thanks lot.
[tmp]$ cat r.sh
#! /bin/sh
name="abcd & co"
echo ${name/&/amp}
[tmp]$ ./r.sh
abcd amp co
[tmp]$
u can use sed as well
name="abcd & co"
name=`echo $name | sed 's/&/amp/'`
echo $name