find | xargs, like this:
find . -name "*.txt" | xargs vim
you get a warning about
Input is not from a terminal
and a terminal with pretty much broken behaviour afterwards. Why is that?
When you invoke a program via
$ true | xargs filan -s 0 chrdev /dev/null 1 tty /dev/pts/1 2 tty /dev/pts/1 $ true | xargs ls -l /dev/fd/
Vim expects its stdin to be the same as its controlling terminal, and performs various terminal-related ioctl's on stdin directly. When done on
You could consider this a bug in Vim, since it can open
Following on from grawity's answer,
-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.
Thus the following line of code should work for you:
find . -name "*.txt" | xargs -o vim
find . -name "*.txt" | xargs bash -c '</dev/tty vim "$@"'
Use GNU Parallel instead:
Or if you want to open all the files in one go:
It even deals correctly with filenames like:
Watch the intro video to learn more: http://www.youtube.com/watch?v=OpaiGYxkSuQ
It should work just fine if you use the -exec option on find rather than piping into xargs. E.g