0
我試着用函數來完成它:如何多次使用管道?
filter-root() {
echo $1 | perl -pe 's/ /\n/g' | perl -pe 's/.*(emacs|libreoffice|autokey|bkubuntu).*//' | perl -pe 's/^\n//'
}
,但它不工作:
$ myList=`git ls-files`
$ filter-root myList
myList
確實如此。其他方法也是我做錯的方式 - 它給出了「手動管道」的不同結果。 – Adobe
哦 - 我解決了它:'filter-root「$ myList」'。感謝Avio--實際上我有一個字符串 - 所以我不認爲需要quoutes。但它只適用於這種方式。 – Adobe