Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

using sed on special char; like "á"

 
Highlighted
Honored Contributor

using sed on special char; like "á"

Here is the server info

9000/800/rp4440
HP-UX HOSTNAME B.11.11 U 9000/800 529435876 unlimited-user license

any suggetion how this type of sed replacent can be done?

What we are trying to achive is replace English char with equivalent Russian descreption. If there is a special char, then no changes are happening.

#locale -a|grep -i ru
ru_RU.iso88595
ru_RU.utf8

below is the variable set

LANG=ru_RU.utf8; export LANG
LC_ALL=ru_RU.utf8; export LC_ALL
LC_COLLATE=ru_RU.utf8; export LC_COLLATE

# grep -i russ swlist.fileset.07092007
International.RUSSIAN B.11.11 RUSSIAN
PHCO_30241.RUSSIAN 1.0 International.RUSSIAN


what is special on this char so that it wont support sed? Any one has any suggetion on how we can accomplish this?
10 REPLIES 10
Highlighted
Honored Contributor

Re: using sed on special char; like "á"

Hi,

Have you tried using an escape (\) character before the special char in the sed sub?


Jov
Highlighted

Re: using sed on special char; like "á"

Can you attach a script that has your sed command with that char?
Highlighted
Honored Contributor

Re: using sed on special char; like "á"

Hi,

to exclude input character woes, I suggest to put the sed commands into a file, like
cat sed.cmd
s/Ae/Ã /g

and call
sed -f sed.cmd

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Highlighted
Honored Contributor

Re: using sed on special char; like "á"

That is what we are trying now.


BTW how did u type that special char?I am not running the sed comand directly and not sure how did the special chars are genearted.
Highlighted
Honored Contributor

Re: using sed on special char; like "á"

sed -f $HOME/$DIRLOC/outmail/$1ResScmd.txt $HOME/$DIRLOC/outmail/RussianResolved.txt_$1 > $HOME/$DIRLOC/outmail/$1ResMail.txt 2>> $HOME/$DIRLOC/outmail/$1ResScmdErr.txt
Highlighted
Honored Contributor

Re: using sed on special char; like "á"

Hi,

what is the result of the sed command?
Is there any error message?

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Highlighted

Re: using sed on special char; like "á"

Your attached bitmap isn't all that helpful. A .txt file with your script ($1ResScmd.txt) and your shell history would be much more helpful.

If cut&paste loses the special char from your history, you can use history -40 > file to save it.
Highlighted

Re: using sed on special char; like "á"

While waiting for the script, I noticed that I get mail with the subject. That message had these chars: "à ¡"
(Hmm, it looked like "u" with a circumflex and an "A" with a grave accent. Where the subject above looks like an "a" with an accent.)

This had the hex pattern of 0xc3 0xa1. I had no problems using sed with those two chars.
Highlighted
Honored Contributor

Re: using sed on special char; like "á"

An update

"Looks like getting all the character sets on the same page corrected the sed issue, as far as the Russian characters causing it to fail".

The investigation is still going on..