开发者

Addressing Ambiguous Redirect in Unix Pipe

开发者 https://www.devze.com 2023-02-07 18:18 出处:网络
I have a code that looks like this: #!/usr/bin/bash file1=foo.txt file2=bar.txt ouput=output.txt join $file1 <(cut -f1 $file2 | sort -u) > $output

I have a code that looks like this:

#!/usr/bin/bash
file1=foo.txt
file2=bar.txt
ouput=output.txt

join $file1 <(cut -f1 $file2 | sort -u) > $output

# We will further process $output

But it give me such error.

./mycode.sh: line 4: $output: ambiguous redirec开发者_运维百科t

Is there a way to address it?


cut -f1 $file2 | sort -u > sort.txt
join $file1 sort.txt > $output

just a bit curios, you don't get any other error message?

0

精彩评论

暂无评论...
验证码 换一张
取 消