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.
所以我正在尝试创建一个别名,该别名将在我们工作室的应用程序中直接打开最新文件。
我得到了最新的文件:
ls -t .ext | head -1
当我只运行那条线时效果很好,但如果我尝试:
echo "ls -t .ext | head -1" app "ls -t .ext | head -1"
我得到这个返回而不是文件打开:
ls -t <all the files in the directory> | head -1
有任何想法吗?非常感激。
尝试
app `ls -t .ext | head -1`
或者
app $(ls -t .ext | head -1)
其中任何一个都获取输出head并将其替换到命令行中。
head