[SAC-HELP] two scripts have DOS line endings

Arthur Snoke snoke at vt.edu
Fri Sep 18 12:21:01 PDT 2009


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




More information about the sac-help mailing list