MLUG: Re: [MLUG] backup via cron
Re: [MLUG] backup via cron
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
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?

Dan

Mike Miller wrote:
On Sat, 4 Feb 2006, Stephen Montgomery-Smith wrote:

My theory was wrong. I don't know why the semi-colon fixed the script. Maybe it is a bug with bash.

I doubt that your theory was completely wrong. He might have deleted the carriage return inadvertently (they are invisible in nano). It is possible that some other invisible character was there. This kind of thing comes up a lot with my students. I was once stumped on a problem and found out with the help of one of our supercomputer staff that one character in my script was something weird. I don't know where it came from. Many programs will show some characters as spaces when they are not space characters. Here are two things I've sometimes done when I can't figure out what's wrong:


less -u filename

tr -d '[ -~]\n' < filename | wc

The less command will reveal the carriage returns as ^M characters highlighted in reverse video.

The tr command deletes all characters not in the normal ascii set. The tr command followed by wc should return all zeros like this:

# tr -d '[ -~]\n' < .cshrc | wc
0 0 0

If it does not return all zeros, there's something in the file such as a control character or other weirdness. You can redirect the output of tr to a file and examine what you have:

# tr -d '[ -~]\n' < filename > test_file_to_examine.out

Once you figure out what the characters are, you can go back to your original file and try to repair it.

Mike

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members

_______________________________________________ members mailing list EMAIL:PROTECTED http://mlug.missouri.edu/mailman/listinfo/members