简体   繁体   English

在makefile中使用grep命令?

[英]Using grep command in makefile?

I'm trying to use this command in (#!/bin/bash) makefile: 我试图在(#!/ bin / bash)makefile中使用此命令:

grep 'svseed' tc_1/tc1.log | awk '{print $7}'

If I use this command in my terminal its working fine. 如果我在终端中使用此命令,它将正常工作。 But if i use it in makefile its not printing the value of $7 . 但是,如果我在makefile中使用它,它不会打印$7的值。 I came to know that its searching for the ($7) variable in makefile. 我知道它在makefile中搜索($7)变量。 I want that ($7) variable to store in any other variable 我希望将($7)变量存储在任何其他变量中

How is not there in the makefile, how to solve this issue? makefile中怎么不存在,如何解决这个问题?

Is this possible or not? 这有可能吗?

Try: 尝试:

grep 'svseed' tc_1/tc1.log | awk '{print $$7}'

To escape a dollar sign in a makefile, you have to double it. 要在生成文件中转义美元符号,您必须将其加倍。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM