当我使用 “猫TEST.FILE”,它会显示从文件读取时如何保留反斜线?
printf "This is a test log %d \n, testid";
1
2
当我使用bash的文件,
IFS=""
while read data
do
echo "$data"
done << test.file
它会显示
printf "This is a test log %d n, testid";
1
2
的 “\”离开了。
有什么办法可以保持“\”和空格在同一时间吗?
我想你的意思'
'信息bash',搜索 “读” 条命令:“反斜线字符'\'可用于删除下一个字符读取和行续行的任何特殊含义。” (这不能解决问题,但它解释了它。) –