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

前端 未结 6 1506
走了就别回头了
走了就别回头了 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:41

    Two useful shell options that can be added to the bash command line or via the set command in a script or interactive session:

    • -v Print shell input lines as they are read.
    • -x After expanding each simple command, for command, case command, select command, or arithmetic for command, display the expanded value of PS4, followed by the command and its expanded arguments or associated word list.

提交回复
热议问题