简体   繁体   English

unix shell中echo和@echo之间的区别

[英]Difference between echo and @echo in unix shells

What's the difference between "echo" and "@echo" in the unix world? 在unix世界中,“echo”和“@echo”有什么区别?

I can't even google special characters. 我甚至不能谷歌特殊字符。

For example, as used here 例如, 这里使用的

That's a Makefile-specific thing ; 那是Makefile特有的东西 ; it has nothing to do with shell scripts. 它与shell脚本无关。

Recipes that begin with @ do not echo the command. @开头的食谱不会回显命令。 That is to say, with a Makefile 也就是说,使用Makefile

foo:
    echo foo

You get 你得到

$ make foo        # <-- this is meant to be the command you enter in the shell
echo foo
foo

Whereas with a Makefile 而使用Makefile

foo:
    @echo foo

it is 它是

$ make foo
foo
applemcg.$ fbdy newest trace_any
function newest
{ 
    trace_call $# $*;
    [[ -f "$1" ]] || { 
        trace_call NO $1;
        return 1
    };
    t=$1;
    shift;
    while [[ -n "$1" ]]; do
        [[ "$t" -ot "$1" ]] && { 
            trace_call NEWER $1 than $t;
            return 1
        };
        shift;
    done;
    trace_call NEWEST $t;
    return 0
}
function trace_any
{ 
    printf $* 1>&2
}
applemcg.$ 

so, the "make paradigm" is 所以,“制作范式”是

newest outputfile inputa inputb... || {

      command input...   > outputfile
}

and you cat toss your makefiles on the scrap heap of history. 你把你的makefile扔在历史废料堆上。

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

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