.bashrcファイルを使用してbashからコマンド出力を読み取ろうとしますwhile loop
。
while read -r line
do
echo "$line"
done <<< $(find . -type f)
私が得た結果
ranveer@ranveer:~/tmp$ bash test.sh
./test.py ./test1.py ./out1 ./test.sh ./out ./out2 ./hello
ranveer@ranveer:~/tmp$
その後私は試しました
$(find . -type f) |
while read -r line
do
echo "$line"
done
しかし、エラーが発生しましたtest.sh: line 5: ./test.py: Permission denied
。
それでは、現在の行全体を一度に読むと思うので、1行ずつどのように読みますか?
希望の出力:
./test.py
./test1.py
./out1
./test.sh
./out
./out2
./hello