Archive for the ‘Linux’ Category

Matching new lines (\n backslash n) in grep

September 12, 2009

Spent some time getting this to work. Say you want to match “1\n;”, the way to do this is:
"1[\][n];"

Paste into VIm without screwing up formatting

August 5, 2009

Often pasting text into vim from an external source screws up the formatting (especially tabs). To prevent this, do:
:set paste

Keeping this setting on screws up auto indentation while in insert mode, though. So to turn off, use
:set nopaste

Piping command outputs into script arguments

August 5, 2009

command | ./myscript does not work as expected.
Use ./myscript $(command) instead