Computing.Net > Forums > Unix > SED using special characters

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

SED using special characters

Reply to Message Icon

Original Message
Name: john
Date: April 2, 2003 at 12:21:24 Pacific
Subject: SED using special characters
OS: Win 2000 sp3
CPU/Ram: 1200 mhz
Comment:

I am trying to change a spacial character after I convert an ebcdic to ascii file. It has trouble with the special character so I need to change it to a ~. I am not sure if this is working properly.

CNT=`grep -c "Í" $AAAA`
if [[ $CNT = 0 ]]
then
mv $AAAA $AAA
else
sed "s/Í/~/g" $AAAA >$AAA
fi


Report Offensive Message For Removal


Response Number 1
Name: David Perry
Date: April 3, 2003 at 04:33:59 Pacific
Reply: (edit)

For arithmetic operations use the operators

-eq, -gt, -lt, -ne

if [ `grep -c H $AAAA` -eq 0 ] ; then


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software