tee to a file descriptor


tee to a file descriptor $ tee >(cat – >&2) the tee command does fine with file names, but not so much with file descriptors, such as &2 (stderr). This uses process redirection to tee to the specified descriptor.

In the sample output, it\’s being used to tee to stderr, which is connected with the terminal, and to wc -l, which is also outputting to the terminal. The result is the output of bash –version followed by the linecount

* View this command to comment, vote or add to favourites * View all commands by camocrazed

commandlinefu.com

by David Winterbottom (codeinthehole.com)

URL: http://feedproxy.google.com/~r/Command-line-fu/~3/pRzpSThZ6IQ/tee-to-a-file-descriptor

\"Enhanced

when you press f9 \’paste\’ is on , press f9 again and \’paste\’ is off, and so forth (works in insert-mode and command-mode)


vim\’s pastetoggle: when you press f9 \’paste\’ is on , press f9 again and \’paste\’ is off, and so forth (works in insert-mode and command-mode) $ nmap :set paste!:set paste? Sets as paste toggle, with visual confirmation of state

* View this command to comment, vote or add to favourites * View all commands by Vilemirth

commandlinefu.com

by David Winterbottom (codeinthehole.com)

URL: http://feedproxy.google.com/~r/Command-line-fu/~3/jGHf9FmLuUI/vims-pastetoggle-when-you-press-f9-paste-is-on-press-f9-again-and-paste-is-off-and-so-forth-works-in-insert-mode-and-command-mode

\"Enhanced

List of commands you use most often

$ history | awk \'{a[$2]++}END{for(i in a){print a[i] \" \" i}}\' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo \'plot \"/tmp/cmds\" using 1:xticlabels(2) with boxes\') Plot your most used commands with gnuplot.

by David Winterbottom (codeinthehole.com)


URL: http://feedproxy.google.com/~r/Command-line-fu/~3/6MxHiSiINdo/list-of-commands-you-use-most-often

\"Enhanced