Re: [UNIX NEWBIE] - scripting help

From: Mark A. Heilpern (
Date: 02/12/99

What Eric presented was an alternative to your dos2unix tool, not a way
to handle an entire directory. How you script a mass conversion is
based on the shell you use. As long as you've got bash in /bin/bash,

for filename in *.c; do
  dos2unix $filename >_tmp_file
  mv _tmp_file $filename
#--------- end of the script. make the script executable!

You'll note I didn't rename the file to have a k on the end, I just
made it more simple since it's a temp file only.

At 11:02 AM 2/12/99 -0600, you wrote:
>try something like....
>/bin/ls -1 | gawk '{system("tr -d \"\\015\" < "$1" > "$1".tmp");system("mv
>"$1".tmp "$1);}'
>> dos2unix act.comm.c >
>> mv act.comm.c
>> dos2unix ban.c >
>> mv ban.c
>> etc etc...

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 12/15/00 PST