Live Chat!

Squeeze multiple blank lines to one

* * * * * 2 votos

March 10th, 2007 toydi

Documents like RFCs may contain many blank-line blocks.
To save the trees, i always squeeze multiple blank lines down to single blank line, before printing.
Once I did this manually (yes, it’s like hell), but now I use cat -s:
cat -s rfc2324.txt | tr -d ‘\\f’ | lpr
I use tr -d to remove any form feed character, [...]

Posted in Text Manipulation, cat, lpr, tr | Hits: 11622 | No Comments »

changing upper/lower case with tr

* * * * * 1 votos

August 4th, 2006 mysurface

tr is actually a common translator, here I show you how to convert
string from uppercase to lowercase
echo “UPPER” | tr [A-Z] [a-z]
from lower to upper
echo “lower” | tr [a-z] [A-Z]
[中文翻译]
Related Postsmakes application hang less, changing the nice valueYou can run a program with different nice, by default is 0 and the nice value is between [...]

Posted in Text Manipulation, tr | Hits: 4601 | No Comments »