小编Atu*_*tul的帖子

语法错误:“(”意外

直接在终端上执行以下命令时,其工作正常:

comm -2 -3 <(sort FileOne.txt) <(sort FileTwo.txt) > myFile.txt
Run Code Online (Sandbox Code Playgroud)

但是在尝试通过.sh文件执行它时,出现错误:Syntax error: "(" unexpected

这是我的代码:

#!/bin/bash
##this will return the unique lines from the first file.
comm -2 -3 <(sort FileOne.txt) <(sort FileTwo.txt) > myFile.txt
Run Code Online (Sandbox Code Playgroud)

我这样运行脚本:

sh ./myfilename.sh
Run Code Online (Sandbox Code Playgroud)

请帮我解决它。

谢谢!

command-line bash scripts

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

bash ×1

command-line ×1

scripts ×1