col -bx < fisierorig > fiserfaraM
That's all.

Moderator: Moderatori
Salut qbic,qbic wrote:Daca deskideti (pt editare) un fisier care a fost salvat pe win o sa observati niste caractere "^M" la finalul randurilor. Ca sa le scoatetzi rulati comanda:
col -bx < fisierorig > fiserfaraM
That's all.
Code: Select all
#!/bin/bash
#
# Remove all those annoying ^M characters that Winblows editor's like to
# add from all files in the current directory and all subdirectories.
# Written by: Jonathan Haase > improved by Void & john
echo "Backup all your files NOW!when you are finished, comment lines"
echo "7, 8 and 9 - including the word <exit> ;-)"
exit
find . > FILELIST.$$
grep -sv FILELIST FILELIST.$$ > FILELIST2.$$
grep -sv $(basename $0) FILELIST2.$$ > FILELIST.$$
grep -sv "^\.$" FILELIST.$$ > FILELIST2.$$
grep -sv "images" FILELIST2.$$ > FILELIST
grep -svE "\.(jpg|gif|png|tiff|psd|zip|tar|gz)" FILELIST2.$$ > FILELIST
rm FILELIST2.$$
rm FILELIST.$$
for i in $(cat FILELIST); do
if [ -f $i ]; then
sed -e s/M//g $i > $i.tmp
mv $i.tmp $i
fi
done
rm FILELIST