The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cp script error, pls help in debugging!!!! wrapster UNIX for Advanced & Expert Users 1 05-24-2008 08:12 AM
which one method is best for debugging the shell script? psiva_arul UNIX for Advanced & Expert Users 2 05-20-2008 06:33 AM
Nee help debugging script..plz gzs553 Shell Programming and Scripting 8 11-24-2006 11:21 AM
FTP script debugging alfredo123 Shell Programming and Scripting 1 11-08-2006 01:22 PM
HP-UX Debugging Shell script shihabvk Shell Programming and Scripting 1 04-24-2006 09:55 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-23-2008
wrapster wrapster is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 193
debugging a script??

Hi all,

Am working on a script to understand the flow control of it..
Since i am from a C background i looking out for an easy way to analyze the script as it runs ..

In C/C++ we have F7 that starts execution from main() and proceeds accordingly..
I was wondering if there is a same approach for shell scripts..

These are what i already tried..

bash -xv <script>
this is a little hard to understand (esp when the script itself runs into pages)
i tried understand function by function by using "set +x and set -x"
that was of little help..

so can anyone help me out on this??

Thanks
  #2 (permalink)  
Old 03-24-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,861
Debugging a shell script is entirely different than debugging a Visual C/C++ program. Sorry but there is no F7 available to help you. echo and print are you friends.
  #3 (permalink)  
Old 03-25-2008
adderek adderek is offline
Registered User
  
 

Join Date: Sep 2007
Location: Poland
Posts: 99
1. You could use debuggers to debug a script - there are some available
2. If you are trying to understand a script then this is not debugging it - unless someone created it correctly (indentation, comments, readable names, good code organization, etc.) you have to read it line by line or at least part by part. This is the same as with obfuscation and reading C code that you cannot compile to debug it
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0