Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想对从命令返回的文件执行一个函数,例如:
less {ls ./my dir | tail -1}
但是我做错了什么,但不能把我的手指放在它上面:
invalid suffix character in obsolescent option
使用 xargs:
ls ./my dir | tail -1 | xargs less
您使用了错误的分隔符集:
less "$( ls ./mydir | tail -1)"