[ISSUE]shell 命令问题

###shell

对于路径中带空格的,加上引号,好比 ./"JS Crystal Craze Mac.app/Contents/MacOS/JS Crystal Craze Mac"app

若是是在遍历的路径中带有空格,如何处理oop

http://unix.stackexchange.com/questions/9496/looping-through-files-with-spaces-in-the-namesspa

摘录:unix

Short answer (closest to your answer, but handles spaces)code

OIFS="$IFS" IFS=$'\n' for file in `find . -type f -name "*.csv"` do echo "file = $file" diff "$file" "/some/other/path/$file" read line done IFS="$OIFS"

Better answer (also handles wildcards and newlines in file names)get

find . -type f -name "*.csv" -print0 | while IFS= read -r -d '' file; do echo "file = $file" diff "$file" "/some/other/path/$file" read line </dev/tty done

 

###it

shell 中关闭蜂鸣器:setterm -blength 0io

相关文章
相关标签/搜索