Process with tee is not exiting out


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Process with tee is not exiting out
# 1  
Old 03-28-2012
Process with tee is not exiting out

Hi

I have a script which we are calling as below from another script but it does not exit out and just hang there.

main.ksh
Code:
#!/bin.ksh
echo "test1"
test.ksh | tee /tmp/abc.txt
echo "test2"

it prints test1 and then just hangs on test.ksh | tee /tmp/abc.txt
if i check the messages from test.ksh then it is going till last statement

seems within test.ksh there are few other things happening which are not completed so tee is still holding the process. If i do ps -ef | grep ...
then i can see only test.ksh | tee /tmp/abc.txt and dont see any other specific subprocess etc

I just want to find out what exactly is causing this issue and how to troubleshoot it,

any help would be really appreciated.

Last edited by Corona688; 03-28-2012 at 04:03 PM..
# 2  
Old 03-28-2012
Without knowing what the contents of test.ksh are, I can't possibly tell you why it's hanging, only guess.

The line #!/bin.ksh doesn't look right, try $!/bin/ksh

If test.ksh tries to read from stdin, it will wait for user input like anything else would.
# 3  
Old 03-28-2012
Thanks for reply
first line is not an issue.

I agree that without looking detail of the other script its tough to say, even i dont have much info on other script that's the reason i am looking for ways to troubleshoot or debug or find possible causes which might have faced by other members in past.

1. script waiting for input from stdin -- [this is not the case]
# 4  
Old 03-28-2012
Are you saying that you do not have read permissions to the script?

Can you do sh -vx test.ksh and post the output here ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mindboggling difference between using "tee" and "/usr/bin/tee" in bash

I'm on Ubuntu 14.04 and I manually updated my coreutils so that "tee" is now on version 8.27 I was running a script using bash where there is some write to pipe error at some point causing the tee command to exit abruptly while the script continues to run. The newer version of tee seems to prevent... (2 Replies)
Discussion started by: stompadon
2 Replies

2. Shell Programming and Scripting

Help with tee command

In the current directory , I have seven files . But when I use the following command , it lists eight files ( 7 files + file_list.xtx) ls -1 | tee file_list.xtx | while read line; do echo $line ; done Does the tee command create the file_list.xtx file first and then executes the ls -1... (1 Reply)
Discussion started by: kumarjt
1 Replies

3. Shell Programming and Scripting

tee and functions

Greetings! My apologies if this has been answered elsewhere before. What I have is a function (as below) set up to append to either an error log or info log based upon input. myLOGGER () { if ]; then logfile=$elog lastERROR="$1" #used elsewhere in my script else... (2 Replies)
Discussion started by: reid
2 Replies

4. AIX

How to kill exiting process in AIX

I could not able to kill two process which is running in the required port for me.Can any body help me to kill the exiting process. - 27000908 - - - <exiting> - 30998528 - - - <exiting> (8 Replies)
Discussion started by: sasikanta
8 Replies

5. Shell Programming and Scripting

tee + more command

script1: #!/bin/ksh more test.txt script2: calling the script1 #!/bin/ksh /tmp/script1.sh 2>&1 | tee tee.log where test.txt contains ~1200 lines. When I execute the script2 the more command does not print pagewise it goes to the end of the line, when I remove the tee command it... (4 Replies)
Discussion started by: prasad111
4 Replies

6. Shell Programming and Scripting

Using tee

I have been using the command tee to store the output to a file and also write on the terminal. However I would need to put the program in the background although I would still need to see the file being updated like it was doing when using tee. Any suggestions on how to look at the log file... (3 Replies)
Discussion started by: kristinu
3 Replies

7. Shell Programming and Scripting

tee

Someone recently advised me to use the tee command to write to standard out. Why would you pipe your commands to tee -a <filename> rather than just using >> <filename> ? For example: date|tee -a myfile seems to be the same as date >> myfile Is there a benefit to... (5 Replies)
Discussion started by: fracken_toaster
5 Replies

8. Shell Programming and Scripting

SSH starting nohup'd process - not exiting

I'm trying to ssh into a remote server, run a script which may or may not start a nohup'd background process and then exit leaving the process running on the remote server. I'm looping through a number of servers to do this but the script hangs as soon as it comes to a server where the remote... (3 Replies)
Discussion started by: Steve_H
3 Replies

9. UNIX for Dummies Questions & Answers

tee

hello how to append the hostname to each line of a file that is tee'd for example: tail -f file1 | tee file2 Iwant file2 to have the same new lines of file1 but with the hostname at the end or the beginning of each line. btw, is there more proper method than: tail -f file1 | tee... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

10. UNIX for Dummies Questions & Answers

Exiting eXceed window kills my process

Hi, I run a binary application with GUI accessibility. To launch and close the application i follow the following steps: 1.Log into a console session. Export display to the local workstation. 2.Launch X windows app ( eXceed ) 3.From terminal session go to the my application directory and... (2 Replies)
Discussion started by: shantaputi
2 Replies
Login or Register to Ask a Question