redirecting output of set -x
I have written a script and included the command
Code:
set -x I want to redirect the output of set -x to a file Code:
set -x >>file.log Code:
exec 1>file.log Please suggest a solution to redirect the output of this command to a file. |
Try it this way:
Code:
./script > file.log 2>&1 |
I want do all this redirection from the same script...
when i tried Code:
./script > file.log 2>&1 |
I am not sure I understand what you mean? What i have given you will redirect all output into the log file.
|
I have a script read.sh in which i have the statement set -x
I want redirect the logs of read.sh to a file.log from the script read.sh itself. The solution you suggested is working file but, once the script is run it doesnt stop, It gets stuck even though the file.log is created. |
Well that would mean there is an issue with your script. The redirection will in no way control the scripts exit abilities.
Maybe if you show the read.sh script we can see why it never stops? |
I have decided not to redirect the output of set-x instead just redirect the error messages to an another log file. I am unable to post the script as it is related to the project i'm working for.
Thank you for your help. |
Well my only suggestion would be that you investigate anywhere you have a loop as it may well be there that it is getting stuck.
Also, if you can find a way to take out the secret stuff and show us something supposedly doing the same thing, we may be able to help diagnose the problem. Good luck :) |
All times are GMT -5. The time now is 11:02 PM. |