当我使用"cat test.file"时,它会显示
1
2
3
4
Run Code Online (Sandbox Code Playgroud)
当我使用bash文件时
cat test.file |
while read data
do
echo "$data"
done
Run Code Online (Sandbox Code Playgroud)
它会显示出来
1
2
3
4
Run Code Online (Sandbox Code Playgroud)
我怎么能像原始测试文件一样制作结果?
当我使用"cat test.file"时,它会显示
printf "This is a test log %d \n, testid";
1
2
Run Code Online (Sandbox Code Playgroud)
当我使用bash文件时
IFS=""
while read data
do
echo "$data"
done << test.file
Run Code Online (Sandbox Code Playgroud)
它会显示出来
printf "This is a test log %d n, testid";
1
2
Run Code Online (Sandbox Code Playgroud)
"\"消失了.
有什么方法可以同时保留"\"和空格吗?
bash ×2