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



How can I Debug a shell scripts and Perl scripting?? or How do you debug a shell scripting and per..

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

How can I Debug a shell scripts and Perl scripting?? or How do you debug a shell scripting and per..

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

How can I Debug a shell scripts and Perl scripting?? or How do you debug a shell scripting and per..

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

How can I Debug a shell scripts and Perl scripting?? or How do you debug a shell scripting and per..

Answer / ram

We can also use below command to debug the script
bash -xv <scriptname.sh>

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Shell Script Interview Questions

What does echo mean in scripting?

0 Answers  


Explain about sourcing commands?

0 Answers  


How to print some text on to the screen?

2 Answers  


How to group the commands in shell scripting?

2 Answers   Polaris,


How do I open the shell prompt?

0 Answers  


Is shell scripting a programming language?

0 Answers  


Is shell scripting useful?

0 Answers  


What are the advantages of shell script?

0 Answers  


what do u mean by $#,$* in unix programming?

5 Answers   Convergys, TCS,


if i have 2 files file1 and file2.... file1 contains 2 columns like b a 11 aa 12 as 13 ad 15 ag 11 ar 13 ah 15 ak file2 contains b c 10 ds 11 at 15 gh 15 jk 13 iu 11 fg 13 yy can any 1 give me the program to display in this way? a b c aa 11 at ar 11 fg ad 13 iu ah 13 yy ag 15 gh ak 15 jk

3 Answers  


What are the four fundamental components of every file system on linux?

0 Answers  


what are special characters and explain how does text varies by the usage of single quotes,double quotes and back quotes?

1 Answers  


Categories