簡體   English   中英

Shell編程:如何在魚中使用find?

[英]Shell programming: How to use find in fish?

請參閱以fish執行的以下命令,然后執行bash:

tmp ) touch file1 file2 file3 file4
tmp ) find . -exec echo {} \;





tmp ) bash
^_^ ~/tmp > find . -exec echo {} \;
.
./file3
./file2
./file1
./file4

為什么魚不理解echo {} \\;

謝謝卡爾。

{}在魚類中有特殊含義。 他們需要進行轉義才能使用find ,例如:

find . -exec echo \\{\\} \\;

從以下錯誤報告中可以使用'{}' ,這在我看來是更整潔的語法。

所以你最終會find . -exec echo '{}' \\; find . -exec echo '{}' \\;

https://github.com/fish-shell/fish-shell/issues/95

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM