Thread: two scripts have DOS line endings

Started: 2009-09-18 22:21:01
Last activity: 2009-09-18 22:21:01
Topics: SAC Help
Arthur Snoke
2009-09-18 22:21:01
Somehow, two of the scripts in sac/bin ended up with DOS line ending so
will not work. That is, every line in these text files end in \r\n
instead of the Unix \n.

These scripts are sgftoeps.csh (used to translate .sgf graphics files to
EPS files) and sgftox.csh (used to produce a screen display of a .sgf file
using gs).

Corrected scripts wil be included with the patches we will be uploading to
IRIS.

In the meantime, if you want to fix these files yourself, on Linux you can
use dos2unix, in many editors if you read in a text file you can do a
"save as" and choose Unix line endings, or you can use the following
script:

====================
#!/bin/tcsh
#
# Transforms DOS line endings to unix line endings by deleting all \r

cat $1 | tr -d "\r" > "$1".tmp
\mv "$1".tmp "$1"
chmod a+x "$1"
===================

If the file is named erase_cr,

chmod a+x erase_cr
erase_cr sgftox.csh
erase_cr sgftoeps.csh


Page built 19:56:50 | v.b'59d0d2