LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-22-2006, 03:50 PM   #1
solarblast
LQ Newbie
 
Registered: Nov 2004
Posts: 21

Rep: Reputation: 15
Debugging a Bash Shell Script


I have a program that gets executed via a Makefile. One enters make rtlinux, and the make really just gos to a line with:

rtlinux start

rtlinux is a shell script. I believe somewhere in the script that something goes awry and hangs Linux. I'd like to get some idea where in the script it goes wrong. I know I could use make -d rtlinux to get some info from make, but how can I get it out of rtlinux? I placed a number of echo stmts in it with the first one like: echo "Starting dbg" > dbgout, and subsequent ones like echo "Point A" >> dbgout. When the procedure hung again, I hit reset and looked for dbgout, but it wasn't where I expected it to be.

Maybe I need some 'flush' in the rtlinux shell, or perhaps there's a flag I can set?
 
Old 02-23-2006, 01:44 AM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
"bash -x script.sh" runs the script in `trace-mode'; that is, bash prints out every line of code the script executes. I think that's more or less what you want.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Shell script bd1308 Linux - Hardware 9 08-22-2005 05:38 PM
bash shell script globeTrotter Linux - Newbie 5 06-03-2004 05:07 AM
bash shell script naka0naka Linux - Newbie 7 05-28-2004 03:06 PM
bash/shell script mikis Programming 2 10-14-2003 11:39 AM
BASH shell script help ewarmour Programming 8 05-24-2002 07:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration