routing kill output from console to file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers routing kill output from console to file
# 1  
Old 05-05-2005
routing kill output from console to file

Hi ,

I am using the following command

kill -3 pid ----which will return the thread dump.

I want redirect this to file.

I tried like the following two ways.

kill -3 9843 >> srini.log
kill -3 9852 >> srini 2>&1

But those two cases are failed Smilie

pls let me knwo is there any other way that i can do that...

Thanks in Advance,

srini.
# 2  
Old 05-05-2005
kill is just a command to send a signal to a process. You are redirecting the output of the kill command itself. What the process does upon reciept of a signal is another matter. So

kill -3 9843 > some.file 2>&1

has no effect on what files process 9843 will write to. If process 9843 is not writing to the files you want, you need to add redirects to that process when it is run.
# 3  
Old 04-05-2009
Hi Perderabo,
I too have the same problem as srinivsa has.
Isn't there any way to redirect the output of thread dump to some file rather than stdout.
Actually i have a script where according to some conditions some pid's are generated and then i have to take thread dump in some file which will be used by other program for further analysis,and all this is done inside a for loop.So i want the thread dump to be placed in some output file under /tmp or something.
Could you please help.
Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Print Error in Console and both Error & Output in Log file - UNIX

I am writing a shell script with 2 run time arguments. During the execution if i got any error, then it needs to redirected to a error file and in console. Also both error and output to be redirected to a log file. But i am facing the below error. #! /bin/sh errExit () { errMsg=`cat... (1 Reply)
Discussion started by: sarathy_a35
1 Replies

2. Shell Programming and Scripting

Soft kill a process to redirect the last kbytes output to a file

Hey guys, I have a python script that I call with this line: python mypythonscript.py >> results.csv &The problem is that the redirection from the stdout to the file results.csv only writes 4096 kbyte blocks. So if i kill this process with kill the last kbytes that the script produce will... (6 Replies)
Discussion started by: Mastaer
6 Replies

3. Shell Programming and Scripting

Redirect an output from a script to a file and display it at a console simultaneously

Hi, I'd like to redirect the STDOUT output from my script to a file and simultaneously display it at a console. I've tried this command: myscript.sh | tail -f However, it doesn't end after the script finishes running I've also tried this: myscript.sh | tee ~/results.txt But it writes... (3 Replies)
Discussion started by: wenclu
3 Replies

4. Shell Programming and Scripting

[Shell/Perl(?)] Prepending timestamps to console output & writing results to a file

I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :] By default, the output of TSM's console has no timestamping, making it hard to sort through accurately. This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies

5. Shell Programming and Scripting

How to redirect the output of a cvs command to a file as well as the console.

Hi can anyone tell me how to redirect the ouput of a cvs command to a file as well as the console? i tried using cvs add <filename> | tee logFile cvs add <filename> 2>logFile 2>&1 All i could get is only on console or on file. Please help Thanks (2 Replies)
Discussion started by: ankitag2010
2 Replies

6. UNIX for Advanced & Expert Users

Clean console output routed to a file

A friend routed some console output to a file for me. The problem is he used backspace and escape sequences all over the place. Using vi to view the file makes it difficult to read. Is there a program that will process the backspaces and remove the escape sequences? e.g., bash-3.00$ pwd^ (5 Replies)
Discussion started by: eddyq
5 Replies

7. Solaris

No Console Output

Hey everyone I have a sparc enterprise T2000 I'm trying to install solaris 10 on. The only way I can connect to it is the SER MGT console, but I'm not getting anything to display (in Hyper terminal, or PUTTY) when I boot it. Upon googleing, all I get back is "No output may have been generated.... (4 Replies)
Discussion started by: goodvikings
4 Replies

8. Shell Programming and Scripting

Redirecting output to both console and to a file

Hi All, Is there a way in Bash we can redirection some output to both console and the file at the same time. ~Parag (2 Replies)
Discussion started by: paragkalra
2 Replies

9. AIX

kill -3 <PID> ... where the output file goes?

Hi all, I am generating the coredump of my JBoss, and by default it puts it in to a particular directory. i.e. JBOSS_HOME/. I would like this output file to be created, lets say in /tmp/dump/. I tried the following: kill -3 9404940>/tmp/dump/out.txt But it created... (3 Replies)
Discussion started by: haroon_a
3 Replies

10. AIX

All output at console and in a file at same time ?

I have several backup scripts I am improving which involves mksysb, savevg and tar. Is there a way to have the output of any command sent to the standard output as usual (terminal) and at the same time, send a copy of it all into a file ? Normal outputs and error outputs. Even if I am... (1 Reply)
Discussion started by: Browser_ice
1 Replies
Login or Register to Ask a Question