我需要将结果输出到文件中,但不知道要使用什么命令 - 请问任何想法?
input="/cygdrive/c/dev/test/need_file_size.csv"
trunkRoot=/cygdrive/c/dev/trunk/test-trunk
outputFile=/cygdrive/c/temp/findSizes.log
while read row; do
class=$(echo $row | cut -f 2 -d ",")
find $trunkRoot/ -name "${class}.java" | xargs ls -long
done < "$input"
答案 0 :(得分:0)
input="/cygdrive/c/dev/test/need_file_size.csv"
trunkRoot=/cygdrive/c/dev/trunk/test-trunk
outputFile=/cygdrive/c/temp/findSizes.log
while read row; do
class=$(echo $row | cut -f 2 -d ",")
find $trunkRoot/ -name "${class}.java" | xargs ls -long >> filename
done < "$input"
注意附加到filename
或运行脚本并执行
./myscript >> filename