u-slayer
November 10th, 2008, 10:27 AM
I wanted to write a simple script that would read all the files given to it and replace double spaces with tabs. It works, sometimes but it also seems to randomly erase my files:(. Pls help.:confused:
for f in "$@"; do
echo -e "$f "
cat "$f" | sed 's/\x20\x20/\t/g' > "$f"
done
for f in "$@"; do
echo -e "$f "
cat "$f" | sed 's/\x20\x20/\t/g' > "$f"
done