作者:crane-yuan 日期:2017-05-02
解決方法
使用IFS(the Internal Field Separator),Shell依靠它去決定如何進行單詞分隔。
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in *
do
echo "$f"
done
IFS=$SAVEIFS
建議
在Linux或Unix系統(tǒng)中,命名文件時,最好不要帶有空格,這會給自在帶來麻煩的。
作者:crane-yuan 日期:2017-05-02
使用IFS(the Internal Field Separator),Shell依靠它去決定如何進行單詞分隔。
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in *
do
echo "$f"
done
IFS=$SAVEIFS
在Linux或Unix系統(tǒng)中,命名文件時,最好不要帶有空格,這會給自在帶來麻煩的。