通常,为了在字符串中嵌入引号,\使用(反斜杠)。
反斜杠在 Bash 脚本中是否有不同的含义?
我的下面的代码不起作用:未包含引号,并报告了以下错误:
recursive_merge.sh: line 7: unexpected EOF while looking for matching `''
recursive_merge.sh: line 14: syntax error: unexpected end of file
Run Code Online (Sandbox Code Playgroud)
我没有解释。14号线根本不存在。
#!/bin/bash
#############this file should be in the directory directly upper than p0x. sphnum.txt should also be at the same directory
for i in 02 03 04 05 06 07 09 10 11 12 13 14 15 16 17 20 21 22 23 24 25; do
x=$(grep $i sphnum.txt |cut -c5-6)
y=$(grep $i sphnum.txt …Run Code Online (Sandbox Code Playgroud)