[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: xargs & vi



martin f krafft wrote:
> 
> can anyone please explain this to me?
> 
> seamus:/usr/local/share/phpgw# find . -name Root | xargs vi
> 221 files to edit
> Vim: Warning: Input is not from a terminal
> 
> seamus:/usr/local/share/phpgw# vi `find . -name Root`
> 221 files to edit
> 
> how the heck does vi get the difference between the two methods of
> calling it...

in the first case, vi is inheriting the standard input from his parent
process, xargs. the standard input of xargs is the pipe coming from
find, which is not a terminal...

in the second case, vi is inheriting the standard input from his parent
process, the shell, which is actually connected to a terminal, and
everything works fine.

pietro.



Reply to: