How to debug to a file?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to debug to a file?
# 1  
Old 05-28-2008
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  
Old 05-28-2008
The set -x flag will output the debug to the stdout (screen). The easiest way is to include a load of debug statements in the script and direct them into a log file!
# 3  
Old 05-28-2008
Thanks.

I've just discovered something else that will do exactly what I want.

script -a
 
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. 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

3. Shell Programming and Scripting

Program to insert Delimiters at fixed locations in a file, Can you please Debug it for me??

Can someone please help?I have a file - fixed.txt----------------------------AABBBBCCCCCCDDDEEFFFFGGGGGGHHHIIJJJJKKKKKKLLL----------------------------To insert delimiters at fixed lengths of 2, 4, 6, 3, I created a file text1.txt as-------------------2463----------------------and trying to execute... (10 Replies)
Discussion started by: jd_mca
10 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. 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

7. 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

8. Programming

How to debug C source file using GVD debugger

Anyone pls. help !!! I want to debug C source file using GVD debugger. However, I am unable to find the way to debug source files. Thanks in advance (2 Replies)
Discussion started by: argupta
2 Replies

9. UNIX for Dummies Questions & Answers

How to redirect debug statement to file?

Hi, I need to redirect the debug statements to out.txt {(set -x) >> out.txt} ??? (1 Reply)
Discussion started by: redlotus72
1 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