你好猛砸超級英雄,如何管輸出從發現到PDF閱讀器
我想創建一個簡單的bash函數,管道從輸出找到到一個PDF瀏覽器,類似但限於表示出。
function findpapers {
find ~/papers/ -name *$1* | evince
}
上述功能打開查看器,但不顯示任何所需的文件/路徑。最終,我想顯示所有從輸出的pdf,找到。一個簡單的查找命令,例如:
$ find /home/alex/papers/ -name *erebus*
創建等的輸出:
/home/alex/papers/2000/rowe/seismic_and_acoustic_observations_at_mount_erebus_volcano_ross_island_antarctica.pdf
/home/alex/papers/2008/Jones/infrasonic_tracking_of_large_bubble_bursts_and_ash_venting_at_erebus_volcano_antarctica.pdf
然後想法是在查看器來顯示這兩個PDF文件。
任何想法或建議嗎?如果有幫助,我正在使用Linux Mint。感謝提前堆!
簡單的方法是使用xargs。看[這個問題](http://stackoverflow.com/questions/896808/find-exec-cmd-vs-xargs)。 – BraveNewCurrency