gpt4 book ai didi

linux - 解决 Unix 管道中的模糊重定向

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:11:38 25 4
gpt4 key购买 nike

我有一个看起来像这样的代码:

#!/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

但它给我这样的错误。

./mycode.sh: line 4: $output: ambiguous redirect

有办法解决吗?

最佳答案

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

有点奇怪,您没有收到任何其他错误消息吗?

关于linux - 解决 Unix 管道中的模糊重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4825510/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com