echo “-e” doesn't print anything

后端 未结 10 2187
谎友^
谎友^ 2020-12-03 22:11

I\'m using GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu). And this command:

echo \"-e\" 

doesn\'t print anything. I guess

10条回答
  •  春和景丽
    2020-12-03 22:18

    Another alternative:

    echo x-e | sed 's/^x//'
    

    This is the way recommended by the autoconf manual:

    [...] It is often possible to avoid this problem using 'echo "x$word"', taking the 'x' into account later in the pipe.

提交回复
热议问题