Can you write a script to portray how set –x works?



Can you write a script to portray how set –x works?..

Answer / Prabhat Kumar Chauhan

Here's a simple example demonstrating the use of the set -x flag:n```bashnshell_debug() {n set -xnecho $1nsome_commandnexit 0}nshell_debug 'test' # This will display the command being executed before it is run."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

How to handle the delimiter unit seperator in Unix

2 Answers  


What is the difference between break and continue commands?

1 Answers  


What is awk in shell script?

1 Answers  


Dear All, Can anybody tell me how to predefind no. of selected rows from a text file.

1 Answers   MGL,


c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l

1 Answers  


What are the various stages of a linux process it passes through?

1 Answers  


How to print some text on to the screen?

2 Answers  


What is the command to find out today's date?

1 Answers  


What's the difference between scripting and coding?

1 Answers  


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

5 Answers   Convergys, TCS,


What will happen to my current process when I execute a command using exec?

1 Answers  


Write a shell script to check whether a number is Armstrong number or not?

1 Answers   Flipkart,


Categories