On Jul 8, 2005, at 9:57 PM, Joseph Alotta wrote:
On Jul 8, 2005, at 9:26 PM, Chris Devers wrote:
#!/bin/sh
perl -pi -e "tr/\r//d"
Hi Chris,
I tried to call perl directly. But this does not work
at all. Does anyone know why?
#!/usr/bin/env perl -pi -e "tr/\r//d"
Because using 'env' doesn't preserve switches.
Personally, I use a tcsh alias:
% which dos2unix
dos2unix: aliased to perl -pi -e "tr/\r//d"
But Chris' script could become:
#!/usr/bin/perl -pi
tr/\r//d
which would save one level of processes but no longer search the $PATH.
-Ken