How to redirect debug statement to file?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to redirect debug statement to file?
# 1  
Old 08-02-2005
How to redirect debug statement to file?

Hi,
I need to redirect the debug statements to out.txt

{(set -x) >> out.txt} ???
# 2  
Old 08-02-2005
On the beginning of your script :

#!/bin/ksh
set -x
exec 2>/tmp/${0}.log


Rgds.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Want ro capture the debug in output file

I want to capture the debug for the below command in output file . i tried like this but its not working: sh -xv <scriptname> >> output.log i want the output in a log file. Anyone plz help in this (2 Replies)
Discussion started by: chakkaravarthy
2 Replies

2. Shell Programming and Scripting

redirect input within case statement?

I'm trying to run the logic below but get a `<' is not matched error message when I return a Y or y; printf "Run this ? : " read RESP case $RESP in Y|y) cat <<EOF > file today is Monday EOF ;; N|n) exit 1 ;; esac Any ideas? (2 Replies)
Discussion started by: h8mmer
2 Replies

3. Red Hat

Outputting clive --debug to file?

I am running clive on Linux version 2.6.24.5-85.fc8 (Red Hat 4.1.2-33) with the debug command as follows clive --debug -O <logfile> http://www.youtube.com/watch?v.... I need to get the contents of the debug written to file to extract data later. Using the -O option actually writes the... (0 Replies)
Discussion started by: rob171171
0 Replies

4. Solaris

How to debug .so file??

Hi All, I have a question on debugging the .so file. When I am running makefile I am getting a .so file and we are using that .so file for executing our code.But I want to know 1.Can I use dbx or gdb to debug a .so file? 2.How can i generate .out file so that i can use that in dbx or gdb... (1 Reply)
Discussion started by: s.sen1213
1 Replies

5. Programming

Compile a proc/c++ file in debug mode.

Hi, I'm using the following commands to execute a proc file, but I'm unable to debug the program. What modifications do I need to make in the command options to debug the program created. I have a proc1.pc file, using the following three steps to generate the proc1 exe. After the proc1 exe... (2 Replies)
Discussion started by: ehari
2 Replies

6. Shell Programming and Scripting

Redirect output of print statement to file

:confused: I have a ksh script which gathers data from a file. I need to find a way to direct the output to a new file. The code looks something like this: DUP_FILE=`touch /export/.../.../dup_social_$1` while (($# > 0 )) do # Make sure the file exists if ] then print "$1: does not... (4 Replies)
Discussion started by: Muga801
4 Replies

7. Programming

gdb: problem while debug an executable file

I created one file (test.cpp)and complied it and get the executable file(test) and run it.It is giving the out put but when I am trying to debug that executable.I am getting the error -- please tell me the solutions?? Thanks in advance ..... (2 Replies)
Discussion started by: smartgupta
2 Replies

8. UNIX for Dummies Questions & Answers

How to debug to a file?

I'm trying to debug a script in korn shell At the begining of the script I've got #!/bin/ksh -vx However, this seems to only dump debugging info to the screen. How do I get that sent to a text file? I've tried various redirects but none of them seem to work. Thanks (2 Replies)
Discussion started by: Ant1815
2 Replies

9. Shell Programming and Scripting

Easiest way to send output to a debug file?

I have this in my script: DEBUG_DIR=/log/rotate_output DEBUGLOG=${DEBUG_DIR}/rotate.${TIMESTAMP} SERVER_FILE_LIST="\ wasint0206 /logs/squid_backup wasint0201 /logs/squid_backup" /usr/bin/echo "${SERVER_FILE_LIST}" | while read SERVER DIRECTORY do cd /log/squid_logs/${SERVER}... (2 Replies)
Discussion started by: LordJezo
2 Replies

10. AIX

How to debug a shared library(.so file) on AIX?

How to debug a shared library(.so file) on AIX? (1 Reply)
Discussion started by: AlbertGao
1 Replies
Login or Register to Ask a Question