07-31-2013
Try command & disown If your shell doesn't know what disown is, it doesn't need it, but if it does know, it does need it.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello.
Consider the following magic words:
# ls `which adduser`
ls: /usr/sbin/adduser: No such file or directory
#
Hmmm...
Then:
# ls /usr/sbin/adduser
/usr/sbin/adduser
#
Now what?
Unforunately this little sniippet is used in my debian woody server's mysql pre install script.... (2 Replies)
Discussion started by: osee
2 Replies
2. Shell Programming and Scripting
Hi,
I use the command
ls a\b\c\*.txt
from the command line on HP UNIX and it works fine - It lists all files matching *.txt in the a\b\c directory
When embeded in a ksh script
`ls a\b\c\*.txt`
it does not work - I get *.txt not found (even though there are files)
I tried... (10 Replies)
Discussion started by: GNMIKE
10 Replies
3. Solaris
Hi,
I am working in SunOS 5.8.
I wanted to run a script in background and I gave the following command, but it is not working.
I gave "nohup ksh ULOAD.ksh &"
It just came out giving a msg "Redirection or piping of stdin or stdout is allowed only with -b. (156)" in nohup.out file.
If I... (2 Replies)
Discussion started by: arsheshadri
2 Replies
4. Solaris
Hello All,
Here is a problem of NOHUP.
I am trying to run a process which needs to be up and running even if the session is closed. I tried running it with "nohup", but starngely it is not working, when i exit from the session the process is also getting killed?
plz help me in finding out... (4 Replies)
Discussion started by: shivamasam
4 Replies
5. Shell Programming and Scripting
total=0
seq 1 5 | while read i ; do
total=$(($total+$i))
echo $total
done
echo $totalThis outputs:
1
3
6
10
15
0whereas I am expecting:
1
3
6
10
15
15My bash version: (4 Replies)
Discussion started by: meharo
4 Replies
6. UNIX for Dummies Questions & Answers
I need to sort through a volume that contains video files by access time and delete files that have not been accessed over x days. I have to use the access time as video files are originals that do not get modified, just read
Testing commands on a local test folder...
$ date
Wed Sep 28... (10 Replies)
Discussion started by: canon273
10 Replies
7. Shell Programming and Scripting
Hi all,
I wrote a scirpt (abc.sh) in which I defined a loop with an interval equal to 1 hour. I want this script continue to run when I close the terminal, so I ran the following command,
(in the proper directory)
nohup abc.sh
However the script doesn't just keep running when I... (1 Reply)
Discussion started by: isaacniu
1 Replies
8. Shell Programming and Scripting
Hello, I am trying to run a shell script with the nohup command. The shell script takes an array of files, runs a python program on each file in a loop, and appends the output to a file. This works fine on the server, but if I try to use the nohup command it does not work.
---
#!/bin/sh... (10 Replies)
Discussion started by: ricitron
10 Replies
9. Shell Programming and Scripting
Please I have run a background script using nohup please tell me way to stop this. Thanks in Advance (4 Replies)
Discussion started by: mumakhij
4 Replies
10. Shell Programming and Scripting
Hello,
I am trying to make a bash script, I tested nohup but it did not help me.
My code is:
ffmpeg -i $input_url -c:v copy -c:a copy -listen 1 -f mpegts http://localhost:port/live/test
When I open it in VLC, it starts feeding my screen and I see bitrate values.
When I stop watching it,... (4 Replies)
Discussion started by: baris35
4 Replies
LEARN ABOUT DEBIAN
reptyr
reptyr(1) General Commands Manual reptyr(1)
NAME
reptyr - Reparent a running program to a new terminal
SYNOPSIS
reptyr PID
reptyr -l
DESCRIPTION
reptyr is a utility for taking an existing running program and attaching it to a new terminal. Started a long-running process over ssh, but
have to leave and don't want to interrupt it? Just start a screen, use reptyr to grab it, and then kill the ssh session and head on home.
reptyr works by attaching to the target program using ptrace(2),
redirecting relevant file descriptors, and changing the program's controlling terminal (See tty(4)) It is this last detail that makes rep-
tyr work much better than alternatives such as retty(1).
After attaching a program, the program will appear to be either backgrounded or suspended to the shell it was launched from (depending on
the shell). For maximal safety you can run
bg; disown
in the old shell to remove the association with the program, but reptyr will attempt to ensure that the target program remains running even
if you close the shell without doing so.
OPTIONS
-l
Instead of attaching to a new process, create a new pty pair, proxy the master end to the current terminal, and then print the name
of the slave pty. This can be passed to e.g. gdb's set inferior-tty option.
-s
By default, reptyr will move any file descriptors in the target that were connected to the target's controlling terminal to point to
the new terminal. The -s option will cause reptyr to unconditionally attach file descriptors 0, 1, and 2 in the target, even if the
target has no controlling terminal or they are not connected to a terminal.
-v
Print the version of reptyr and exit.
-h
Print a usage message and exit.
NOTES
reptyr depends on the ptrace(2) system call to attach to the remote program. On Ubuntu Maverick and higher, this ability is disabled by
default for security reasons. You can enable it temporarily by doing
# echo 0 > /proc/sys/kernel/yama/ptrace_scope
as root, or permanently by editing the file /etc/sysctl.d/10-ptrace.conf, which also contains more information about this setting.
BUGS
When attaching to some curses programs, they will not redraw the screen right away, and a ^L or similar will be needed to force a redraw.
Similarly, after attaching to certain programs, the old terminal will be left in an odd state, and a clear or even reset may be required
before the old terminal is usable again.
Attaching to rtorrent (and probably some other apps) doesn't work right (rtorrent stops accepting input) (The problem is that rtorrent is
using epoll to poll stdin, and we don't update the internal reference that the epoll fd has to the old tty).
Attaching to a process with children doesn't work right. This should be possible to fix -- I just need to ptrace each child individually
and do the same games to it.
Attaching a less(1) process doesn't work if you have a .lessfilter file, as less leaves around a zombie child in this case. This could be
worked around.
Bugs should be reported to the author (see below) or via the issue tracker on GitHub.
AUTHORS
reptyr was written by Nelson Elhage <nelhage@nelhage.com>.
HOMEPAGE
<https://github.com/nelhage/reptyr>
SEE ALSO
neercs(1), screen(1)
03 Feb 2011 reptyr(1)