Solved unix file has ^@ character

June 5, 2012 at 14:37:26
Specs: VAX
I did a SFTP from vax machine, the file has ^@ characters that I need to get rid off.
Can you please help how I can conver it on Unix..

See More: unix file has ^@ character

Report •

#1
June 5, 2012 at 15:44:49
✔ Best Answer
This works on Solaris 9. Let me know if you have any questions:

#!/bin/ksh

# cd <to your directory>

ls -1 *^@*| while read file
do
    mv "$file"  $(echo "$file"|sed 's/\^@//g')
done
# end script

EDIT: included ls -1 to make sure each filename appears only on one line.


Report •
Related Solutions


Ask Question