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 |
is there any command to find user password?
What are the advantages of using shell scripts?
write a shell script to check the failed jobs?
Why are there shells on the beach?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
What are the advantages of shell script?
What are different types of shell?
c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again
I Forgot My Windows Vista Password! How Can I Find My Windows Lost Password?
write a shell script to find the largest number from 3 given numbers.
Is shell and terminal the same?
What is the crontab?