Echo command, and then run it? (Like make)

前端 未结 6 1494
走了就别回头了
走了就别回头了 2021-02-02 12:49

Is there some way to get bash into a sort of verbose mode where, such that, when it\'s running a shell script, it echoes out the command it\'s going to run before running it? T

6条回答
  •  时光说笑
    2021-02-02 13:40

    You could make your own function to echo commands before calling eval.

    Bash also has a debugging feature. Once you set -x bash will display each command before executing it.

    cnicutar@shell:~/dir$ set -x
    cnicutar@shell:~/dir$ ls
    + ls --color=auto
    a  b  c  d  e  f
    

提交回复
热议问题