Im trying check if character "�" (alt+145) is included or not in some files. To do that I have written a scrip with vi that basically is a loop of all these compressed files and something like:
zcat $file | grep � >> logtocheck.out ;
The problem is that � is translated to something like "\303\254" (not sure about the exact numbers). Ive been trying some other ways to write this character but didnt succeed. I execute it with ksh.
What you have shown us will copy lines that contain the character � from the file named by the expansion of $file (after uncompressing that file) to the end of a file named logtocheck.out .
If you have this statement in a loop handling all of your compressed files, when you get done you won't know which files contained the matching lines.
If you would give us an explicit statement of what output you're trying to produce, we might be able to help you achieve that goal.
I have some echo with the file name inside the loop redirected to the file logtocheck.out too, so I could follow the results. Basically my problem is how to grep character �.
Assuming that the data in your compressed files was encoded using the same codeset that is underlying the current locale in which you're running this script and was in use when you wrote your script, the grep command you have should be fine.