Addressing Ambiguous Redirect in Unix Pipe
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?
精彩评论