debugging in bash!!! help needed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting debugging in bash!!! help needed
# 1  
Old 02-24-2008
debugging in bash!!! help needed

Hi all,

Am using bash shell.
Am newbie, trying to understand the debugin process of a shell script...
I am unable to comprehend the control flow ,meaning from where exactly the execution of the script begins...

I tried using bash-xv <scriptname> but since am new ,am finding it difficult to understand the script..

Can anyone help me and let me know how to read the output of bash-xv <scriptname>...
I would also like to know of and good doc on the web that explains this in detail....

Help would be much appreciated!!!!
# 2  
Old 02-25-2008
Debugging...

You can remove 'v' option (Verbose) and try the below -

bash -x <scriptname>

If you are not clear of any specific command...then you can check using
man <command>


Hope this helps. Smilie
# 3  
Old 02-25-2008
Hi,
I am having difficulty in understand the control flow of the script...
With many functions involved ,it was kinda difficult to get through...

So i would like to know if there is any command that would follow the execution line by line(more understandably) ...
I mean something like using F7 in C/C++ to understand the flow of calls to funcs and so on!!!!

I can understand simple scripts but the complex ones still elude me...
So if there are any E-books that could help me i would love to have it...

Please advice
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Debugging Help needed

I am VERY much a neophyte with shell scripting. I am working on the following, "Create a script sends an email message to the user specified on the command line if any of the file systems at more than 60% of capacity. The script should not process special file systems as /proc on the... (2 Replies)
Discussion started by: doghouse308
2 Replies

2. Homework & Coursework Questions

Debugging Help Needed

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! I am VERY much a neophyte with shell scripting. I am working on the following, 1. The problem statement, all variables and given/known data: "Create a script sends an... (7 Replies)
Discussion started by: doghouse308
7 Replies

3. Shell Programming and Scripting

Bash Script Help Needed

I have a small script I wrote to look for empty files on a Linux box. It finds the empty files and emails the list to me. That works great. What I need to do now is set a cron job to run the thing every 10 minutes or so (no problems there) but I don't want to get any more emails if the last email... (14 Replies)
Discussion started by: wviands
14 Replies

4. Shell Programming and Scripting

Question related to bash. Your help needed.

Dear Team, i have one question related to automation of adding new users based on txt file. Here we go: I have data.txt file which shows: bang dang benc One by one, after pressing enter. And now, I need scirpt which will add those users with home directory hidden within the file... (7 Replies)
Discussion started by: protos27
7 Replies

5. Shell Programming and Scripting

Help needed on ssh in bash scripting

HI I have the following requirement I have a script a.sh which will deploy files in multiple servers .The argument for the a.sh is abc.gz host1.conf where abc.gz is a zip file and one.conf will contain all the database connection string . Now I have to write a b.sh which will... (7 Replies)
Discussion started by: harry00514
7 Replies

6. Shell Programming and Scripting

Having trouble with My Bash Script, need Help debugging

Hello Friends I am having trouble with my script below. I will describe the problems below the code box. I am hoping that some of the experts here can help me. #!/bin/bash #========================================================================================================= # Rsync File... (8 Replies)
Discussion started by: jdavis_33
8 Replies

7. Shell Programming and Scripting

bash if statement help needed

Hi I need a script with an if statement that goes. I need it to search through all files within a directory with the extension .test if it finds the string '71502FSC1206' then do sed 's/71502FSC1206/\n&/g' > send.test If it finds the string '715MCH' or '715JAC' then I need it to move the... (1 Reply)
Discussion started by: firefox2k2
1 Replies

8. Shell Programming and Scripting

Help needed with bash script providing battery status

I'm really new to even doing a bash "hello world" script, so maybe someone would know how to do the following task, using bash scripting Need to login using ssh from one dell server into another dell server, and obtain the raid battery status, using dell's open manage software commands; then... (5 Replies)
Discussion started by: AJ-102111
5 Replies

9. UNIX Desktop Questions & Answers

Help needed tracing source of bash error

Issue resolved: The 'culprit file' was .bash_aliases. It had the naughty  (ASCII for the octal string Bash was detecting and returning an error about). I cleaned it up in Pico (see my post to the thread on favorite editors if you want background on why I use Pico/Nano), re-sourced it via... (0 Replies)
Discussion started by: SilversleevesX
0 Replies

10. UNIX for Advanced & Expert Users

debugging an already running bash script

# ps -ef | grep rc root 13903 1 0 08:56 ? 00:00:00 /usr/sbin/automount --timeout=60 /archive file /etc/auto_archive root 10706 1 0 08:55 ? 00:00:00 /bin/bash /etc/rc.d/rc 3 root 2933 20071 0 19:38 pts/1 00:00:00 grep rc Is there any way to debug the... (1 Reply)
Discussion started by: marcpascual
1 Replies
Login or Register to Ask a Question