POSTS
Life-Changing Use of xargs
in Ex-FacebookOnce, on Facebook I wrote:
vim
has a strange way of working with data from xargs
. To make vim
happy,
you need xargs
to send the output into a TTY before handing it to vim
. Per
the xargs
man page:
-o Reopen stdin as /dev/tty in the child process before executing the command. This is useful if you want xargs to run an interactive application.
Extract file names based on STDOUT and then throw them to vim
via xargs
$ grep -o '\[C.*)' https://t.co/KdKaLY85cm |sed 's/.*(\(.*\))/\1/' |xargs -o vim