Debug shell script - Redhat

This is a discussion on Debug shell script - Redhat ; Hello everyone, I am using RedHat Shrike 9.0. I am wondering how to debug shell script, for example, step-by-step debug to watch the outputs of each line of command. Thanks in advance....

+ Reply to Thread
Results 1 to 2 of 2

Thread: Debug shell script

  1. Debug shell script

    Hello everyone,


    I am using RedHat Shrike 9.0. I am wondering how to debug shell script,
    for example, step-by-step debug to watch the outputs of each line of
    command.

    Thanks in advance.


  2. Re: Debug shell script


    "csheppard91" wrote in message
    news:1140568439.092196.6360@g14g2000cwa.googlegrou ps.com...
    > Hello everyone,
    >
    >
    > I am using RedHat Shrike 9.0. I am wondering how to debug shell script,
    > for example, step-by-step debug to watch the outputs of each line of
    > command.
    >
    > Thanks in advance.
    >


    Hi,

    Normally, on the command line, type "sh -x scriptname"
    Alternatively, in the script (line 1) add "set -x" and then run the script
    Hope this helps.

    Cheers.




+ Reply to Thread