How execute bash script line by line?

前端 未结 5 2138
逝去的感伤
逝去的感伤 2020-12-02 05:08

If I enter bash -x option, it will show all the line. But the script will execute normaly.

How can I execute line by line? Than I can see if it do the correct thing,

5条回答
  •  执笔经年
    2020-12-02 05:38

    xargs: can filter lines

    cat .bashrc | xargs -0 -l -d \\n bash
    
    • -0 Treat as raw input (no escaping)
    • -l Separate each line (Not by default for performances)
    • -d \\n The line separator

提交回复
热议问题