#!/bin/zsh # # For each argument file name: *Replace* the file with its # mac-oid tr-fixed replacement. (I.e., translate all the unix # line termination characters ('\n', '\012') with Mac-style # carriage return characters ('\r', '\015'). # # Leave the old one in NAME.unix~ i.e., kinda like an Emacs backup file. # echo Replace these files with their Mac-oid tr replacements: echo " $@" sleep 3 for fn ; do echo Fix $fn /bin/mv $fn $fn.unix tr '\012' '\015' < "$fn.unix" > "$fn" /bin/mv "$fn.unix" "$fn.unix~" done