Click to See Complete Forum and Search --> : Stepping Thru a Bash Script..


c_guy
10-12-2000, 10:15 AM
Hello to all you scripting guru's out there..

Just getting my feet wet and doing a little bash scripting, I have written a few scripts to do some simple tasks, but I have one problem with a script and cannot figure out what line the problem is on. Is there a way to step thru line by line a bash script and view the output?

I may not need this to track down the source of this problem, but it sure would be nice to know how to do this...

Is there a way?

Thanks in advance...

{c}guy

Confoozled
10-12-2000, 10:20 AM
There is a debug option you can enable. If you e-mail me a linuxwannabe@home.com (my home account) I'll look it up in my scripting book for you.... I just need a reminder mail. http://www.linuxnewbie.org/ubb/wink.gif

X_console
10-12-2000, 01:33 PM
At the top of your bash script:

#!/bin/bash -x

-x enables debugging.

ph34r
10-12-2000, 02:31 PM
I will typically throw some echo statements in there to tell me when/where something is and what a data value is too.

c_guy
10-12-2000, 04:17 PM
Thanks For the help guys...

Appreciate it..

http://www.linuxnewbie.org/ubb/smile.gif