![xargs nano 会导致收到 SIGHUP 或 SIGTERM,而 xargs less 则可以](https://linux22.com/image/202460/xargs%20nano%20%E4%BC%9A%E5%AF%BC%E8%87%B4%E6%94%B6%E5%88%B0%20SIGHUP%20%E6%88%96%20SIGTERM%EF%BC%8C%E8%80%8C%20xargs%20less%20%E5%88%99%E5%8F%AF%E4%BB%A5.png)
设想:
$ cat t0.txt
t1.txt
$ cat t1.txt
xxx
$ sed -n 1p t0.txt | xargs less
# OK
$ sed -n 1p t0.txt | xargs nano
Received SIGHUP or SIGTERM
dvl-linux64 $ nano --version
GNU nano, version 2.5.3
如何打开文件nano
?如果没有xargs
,那又怎样?
UPD。关于西维金:
$ sed -n 1p t0.txt | xargs less
# OK
$ sed -n 1p t0.txt | xargs nano
Too many errors from stdin
$ sed -n 1p t0.txt | nano
Too many errors from stdin
Buffer written to nano.save
$ nano --version
GNU nano, version 4.9