[plug] Does anyone know where i can get source for dos2unix?

John Summerfield summer at os2.ami.com.au
Fri Jun 4 07:55:33 WST 1999


> On Thu, 3 Jun 1999, John Summerfield wrote:
> 
> > > > > > for file in $(find .); do tr -d '\r' <$file >/tmp/trimmed; mv -f
> > > > > > /tmp/trimmed $file; done
> 
> > There IS nobody else on my system
> 
> It's still a good idea to get into the habit of writing secure code
> anyway.
> 
> > Neither did anyone else say anything about /tmp.
> 
> What does the script above do then?
> It reads a file, strips the CR characters, and writes it to /tmp/trimmed,
> overwriting any existing file (and overwriting the target of a symlink
> called /tmp/trimmed)

My sugestion was ex (CLI version of vim). Rewrites in place. I didn't read 
the tr suggestion all that closely<g>.

> 
> I stand by my opinion that noone should use /tmp for temporary files like
> that, even on a single-user machine.

If I want a temporary file, I generate its name on the fly.

-- 
Cheers
John Summerfield
http://os2.ami.com.au/os2/ for OS/2 support.
Configuration, networking, combined IBM ftpsites index.




More information about the plug mailing list