Skip to main content
added 8 characters in body
Source Link
Siva
  • 9.3k
  • 9
  • 60
  • 88

I use -x for debug info while executing the shell script.

How can iI redirect debug info only to a file.?

Example script:

#!/bin/bash echo OK echo NO 

i will get the below result when i run in debug mode

+ echo OK OK + echo NO NO 

I would like to redirect only the debug info to a file.

+ echo OK + echo NO 

And runtime output should print on the screen.

OK NO 

I use -x for debug info while executing shell script.

How can i redirect debug info only to a file.

Example script:

#!/bin/bash echo OK echo NO 

i will get the below result when i run in debug mode

+ echo OK OK + echo NO NO 

I would like to redirect only the debug info to a file.

+ echo OK + echo NO 

And runtime output should print on screen.

OK NO 

I use -x for debug info while executing the shell script.

How can I redirect debug info only to a file?

Example script:

#!/bin/bash echo OK echo NO 

i will get the below result when i run in debug mode

+ echo OK OK + echo NO NO 

I would like to redirect only the debug info to a file.

+ echo OK + echo NO 

And runtime output should print on the screen.

OK NO 
Source Link
user305796
user305796

How redirecting debug output to a file

I use -x for debug info while executing shell script.

How can i redirect debug info only to a file.

Example script:

#!/bin/bash echo OK echo NO 

i will get the below result when i run in debug mode

+ echo OK OK + echo NO NO 

I would like to redirect only the debug info to a file.

+ echo OK + echo NO 

And runtime output should print on screen.

OK NO