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

时间:2015-04-11 10:28:07

标签: linux bash shell unix echo

" echo"之间的区别是什么?和" @ echo"在unix世界?

我甚至不能谷歌特殊字符。

例如, 使用here

2 个答案:

答案 0 :(得分:19)

那是Makefile-specific thing;它与shell脚本无关。

@开头的食谱不会回显该命令。也就是说,使用Makefile

foo:
    echo foo

你得到了

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

而使用Makefile

foo:
    @echo foo

它是

$ make foo
foo

答案 1 :(得分:0)

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.$ 

所以,“制作范式”是

newest outputfile inputa inputb... || {

      command input...   > outputfile
}

你把你的makefile扔在历史废料堆上。

相关问题