On Wed, 2003-06-18 at 12:13, Stuart Jansen wrote:
> perl -e 'for (`cat file`) { chomp; print $_,"\\n"; }'

Or, if you use the -p switch to perl it wraps your code in a while(<>){}
loop and prints $_. So you could also do:

  perl -pe chomp <file>

Which I thought was really cool when I discovered it. There's some other
cool switches to make perl one-liners really easy. There's an excellent
tutorial here[1].

Corey

1. http://www-106.ibm.com/developerworks/linux/library/l-p101/


____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to