Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
On Sat, 4 Feb 2006, Daniel Nowlin wrote:
That was the problem. ^M's.
dvd+rw-format -f /dev/dvd;^M
growisofs -Z /dev/dvd -J -r /var/ftp/files;^M
What is funny is when I edit the file with nano I can not get rid of the
^M's. Has got to be a setting in nano or putty?
I wouldn't use nano to get rid of them. I regularly use perl. The
UNIX/Linux system typically comes with dos2unix and unix2dos commands
which I do not like. I prefer my own perl scripts which are very short.
The two that I use are shown below. I call them d2u (short for "DOS to
UNIX") and u2d (short for "UNIX to DOS"):
-------begin u2d on next line----------
#!/usr/bin/perl -i -p
s/$/\r/
-------end u2d on previous line----------
-------begin d2u on next line----------
#!/usr/bin/perl -i -p
s/\r//g
-------end d2u on previous line----------
Just copy the text to files in your path (probably in /usr/local/bin), use
chmod to make the files executable...
chmod a+rx /usr/local/bin/d2u
chmod a+rx /usr/local/bin/u2d
...and you're all set. They handle globbing with wildcards just fine:
d2u *.txt text/*.out
That particular command will delete every carriage return (also known as
^M or \r) from every file matching the specified pattern. It will leave
the newline characters alone. It does not store a backup of the original
files. The commands u2d and d2u are not *exactly* inverse operations, but
in most real-life uses, they are inverse operations. If you want to
understand them fully, which is worthwhile, learn a little more about how
perl works.
I thank Stephen and Jon for helping me to figure out how to make these
little scripts a few years ago.
Mike
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members