#!/bin/sh case $# in 0) tr '\015' '\012' break;; 1) tr '\015' '\012' < $1 break;; 2) tr '\015' '\012' < $1 > $2 break;; *) echo "args: 0 (stdin/stdout), 1 (ifile/stdout), or 2 (ifile/ofile)" exit 1;; esac