How can I Debug a shell scripts and Perl scripting??
or How do you debug a shell scripting and perl scripting (
at the compile time error or run
time error) in Unix environment ?
Answers were Sorted based on User's Feedback
Answer / hema
Using sh -x script argument you can debug(-x option).
Bash shell offers debugging options which can be turn on or
off using
set command.
=> set -x : Display commands and their arguments as they are
executed.
=> set -v : Display shell input lines as they are read.
Hope this answers your question.
Is This Answer Correct ? | 12 Yes | 1 No |
Answer / manas
We can debug only by $? which contains the returned value
of last executed command.
If $? contains 0 value then command run successfully other
wise error occured while running command
Is This Answer Correct ? | 3 Yes | 2 No |
Answer / sushil
In addition to Hema's ans :
We can have some $? statement, echo statements embadded in
script.
In pern we can use -w option to print the warning or erros
generated during compilation, can make use os strict to force
to use good programming practice...
Is This Answer Correct ? | 0 Yes | 1 No |
What is a shell environment?
What are the four fundamental components of every file system on linux?
Write a shell script to looking at the log file to see if the test has passed or not
What is the use of .sh file?
Can we run shell script in windows?
c program to display the information of given file similar to givan by the unix or linux command ls -l
How does shell scripting work?
Where cron file kept?
write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?
how to delete all the files with extension .dat rom a directory tree from root to third level in a single unix command?
Create a bash shell script that reads in a number from the user. If the number is 1, print out the date. If the number is 2, list the files in the current directory. If the number is 3, print out who is currently logged onto the system. If the number is anything else, print out an error message and exit. Name this script "various.sh"
What is awk script?