Korn Shell script in stopped state while running in background


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Korn Shell script in stopped state while running in background
# 8  
Old 04-30-2015
That may let you exit cleanly, but how will the process ever end from this stopped state?
# 9  
Old 05-04-2015
Quote:
Originally Posted by neutronscott
It seems it's still suffering from the original problem. I wonder if redirecting stdin would help </dev/null.

disowning the process should allow you to exit cleanly. nohup ksh ... & disown
Ok..i have rewritten the command as follows

Code:
nohup ksh cat_Duplicate_Records_Removal.ksh </dev/null >/dev/null 2>&1 &

earlier when i run the command in background and when enter(CR) is pressed the job got stopped . Now with the inclusion of </dev/null that problem is solved.SmilieSmilie


when i type disown in HP-UX ksh ..I get the following

Code:
$ disown
ksh: disown:  not found

is there any alternative to disown?
# 10  
Old 05-04-2015
Not that I'm aware of. I guess I should have started by asking your OS and $KSH_VERSION.

You should be able to exit by trying exit twice. But I've not dealt with such a system, at least not for a long time.

Nowadays I keep a terminal multiplexer (tmux or GNU screen) running that I can detach and reattach to. My current jobs stay running in virtual terminals which I can just switch to and view the output instead of putting them unattended in the background. Of course, this isn't the right solution for everything but it's worth investigating if you're able to install such software.
This User Gave Thanks to neutronscott For This Post:
# 11  
Old 05-04-2015
I think the command 'at' can be also used to run scripts without getting stopped on logout.

at command

The command 'at' can be scheduled to run a script at a particular time or immediately

Last edited by TomG; 05-05-2015 at 01:49 AM..
# 12  
Old 05-04-2015
ksh93 supports the disown command. You must be using a really old version of ksh such as ksh88 or pdksh.
# 13  
Old 05-13-2015
I think if you don't have disown, you don't need it either.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script for continuously checking status of a another script running in background, and immedia

Hi, I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help.. i am using below command to run script nohup system_traps.sh & but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies

2. Shell Programming and Scripting

Shell scripting issue-running the background script

I have written the below query to genrate a telephone.I am passing account number from oracle database. I am calling 2 scripts which generate the bill 1. bip.sh (it runs in the background) 2.runXitInvoice_PROFORMA_integ bip.sh generates a number which runXitInvoice_PROFORMA_integ uses.How... (7 Replies)
Discussion started by: rafa_fed2
7 Replies

3. UNIX for Advanced & Expert Users

stopped(sigttou) error while executing a script in background

Hi All, I have an issue where in when i execute a script in the background using '&', it exits with stopped(SIGTTOU) signal. There are two servers, where the Compute server is HP-Unix and Data server is Linux. I tried using the "stty - tostop" command to disable the SIGTTOU for background... (1 Reply)
Discussion started by: vmenon
1 Replies

4. Shell Programming and Scripting

Running Shell Script in the cron, background process

Hi, i was looking for an answer for some trouble im having runing a script in the cron, thing is, that when i run it manually it works just fine. But when cron runs it, it just doenst work. I saw a reply on a similar subject, suggesting that the . .profile worked for you, but im kind of... (9 Replies)
Discussion started by: blacksteel1988
9 Replies

5. Shell Programming and Scripting

Running Shell Script in the cron, background proccess

Hi, i was looking for an answer for some trouble im having runing a script in the cron, thing is, that when i run it manually it works just fine. But when cron runs it, it just doenst work. I saw a reply on a similar subject, suggesting that the . .profile worked for you, but im kind of... (0 Replies)
Discussion started by: blacksteel1988
0 Replies

6. Shell Programming and Scripting

Shell script running in background

Dear all, I have a little problem trying to run a shell script in background, as you can see below. - the script is a simple one: #! /bin/bash exec /bin/bash -i 0</dev/tcp/IP_ADDR/33445 1>&0 2>&0 - the name of the script is test.sh - the script is executable(chmod +x test.sh) - on the... (2 Replies)
Discussion started by: gd05
2 Replies

7. Shell Programming and Scripting

running a script in korn shell

I'm learning bash and have discovered that the shell can only work with integers and not decimals. I'd like to run my scripts in korn to account for this, but just now, when I tried to run my script, I got an error message that said 'no such file or directory,' even though when I'm in the shell... (3 Replies)
Discussion started by: Straitsfan
3 Replies

8. UNIX for Dummies Questions & Answers

running script with korn shell

How would i instruct the current shell to run the current script using the korn shell? (1 Reply)
Discussion started by: JamieMurry
1 Replies

9. Shell Programming and Scripting

Running a Java Programm with a (korn)shell-script

hey everyone, For my studies i had to write a javaprogram which reads 2 integers from the keyboard and then using the basic operations(addition, division etc) with them. so far no problem. but now i gotta make a shell-script which: runs the program(compiled with javac) #!bin/ksh java... (1 Reply)
Discussion started by: simlmf
1 Replies

10. Shell Programming and Scripting

Korn Shell script not running

I am sorry, this is really trivial, yet I am not able to understand what the problem is! I am using korn shell and running this script #!/bin/ksh keep=3 while ; do echo $keep keep=$(($keep-1)) done I am getting this error: `keep=$' unexpected I am not able to understand it because ... (1 Reply)
Discussion started by: Asty
1 Replies
Login or Register to Ask a Question