LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-05-2011, 07:24 PM   #1
krasl
Member
 
Registered: Nov 2005
Distribution: Fedora 4
Posts: 40

Rep: Reputation: 15
Shell Script Single Step Debugging


Hello! Does anyone know of a way to single-step through Bash shell scripts in order to debug? (similar to the way Windows 98 used to let you single-step through autoexec.bat)

Thanks!

Krasl
 
Old 08-05-2011, 11:18 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Try putting 'set -x' as the second line and then pipe the output (depending on just how big the script is) into a file and read till your hearts content
 
Old 08-05-2011, 11:39 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I believe the OP is asking for the ability to step through the commands manually.

There's no built-in function for that, but you can use a trap with the read command.
There's an example in this section of this page:

http://mywiki.wooledge.org/BashGuide...ices#Debugging
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to print lines when debugging shell script shayke23 Linux - Software 3 03-07-2011 03:54 AM
single shell script to download software updates narendra1310 Linux - Software 2 02-20-2010 02:14 AM
single command in shell script not working farkus888 Programming 5 04-01-2008 01:31 PM
Shell script debugging rbautch Programming 11 07-20-2006 10:33 PM
Debugging a Bash Shell Script solarblast Linux - General 1 02-23-2006 01:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:57 AM.

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