From: "Tim R." Date: 2011-08-29T04:27:28+09:00 Subject: convert unix one-liner to ruby one-liner I would like to append a carriage return to all .txt files. I can do it with unix scripting on the command line, but would like to know what the equivalent ruby solution is (out of curiosity). unix solution: for file in *.txt; do echo >> $file; done The following also works: for file in *.txt; do ruby -p -i -e 'END{puts}' $file; done But simplifying to avoid wrapping in a unix script fails to hit any file except the first from the *.seq list (I don't understand why, since usually ruby one-liners can run batch with this input). ruby -p -i -e 'END{puts}' *.txt Thanks in advance, Tim -- Posted via http://www.ruby-forum.com/.