gpt4 book ai didi

bash - 在 Makefile 中使用带括号的粘贴

转载 作者:行者123 更新时间:2023-12-04 00:44:58 34 4
gpt4 key购买 nike

在 Makefile 中使用带括号的 paste 时遇到问题。

我要运行的指令是:

paste -d " " <(cat file1) <(cat file2 | grep "pattern")

如果我从控制台运行它,它可以正常工作,但是当把它放在 Makefile 中时,括号会导致语法错误:

/bin/sh: -c: line 0: syntax error near unexpected token `('

基本上我需要的是粘贴两个(或更多)文件的内容,但使用 grep 过滤其中的一些内容。

最佳答案

你必须告诉 make 你想使用什么 shell。默认的 (/bin/sh) 不支持进程替换语法。放

SHELL := /bin/bash

在 Makefile 顶部的某个地方。

关于bash - 在 Makefile 中使用带括号的粘贴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17063377/

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