I am seeing some strange behavior on my RHEL6 bash prompt. I often like to execute command lines that look like ...
$ ./myscript > junk 2>&1
... then hit Ctrl-Z and then execute ...
$ bg
$ tail -f junk
blah blah blah blah
blah blah blah blah
But today for some reason I am see that my job stays "stopped" and is not "running".
$ uname -a
Linux myhost 2.6.18-371.11.1.el5 #1 SMP Mon Jun 30 04:51:39 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
$ ./myscript.sh > output-07-JUL-16.txt 2>&1
^Z
+ Stopped ./myscript.sh > output-07-JUL-16.txt 2>&1
$ bg
+ ./myscript.sh > output-07-JUL-16.txt 2>&1 &
$ jobs
+ Stopped ./myscript.sh > output-07-JUL-16.txt 2>&1
$ jobs
+ Stopped ./myscript.sh > output-07-JUL-16.txt 2>&1
The script I am running is nothing exotic ...
#!/bin/sh
count=
wc -l hostlist
total=1
for i in grep -v "^#" hostlist
do
echo "Doing $total or $count $i"
sudo scp -q access.sh $i:/tmp
sudo ssh -q $i /tmp/access.sh
sleep 1
total=expr $total + 1
done
Asked by Red Cricket
(2233 rep)
Jul 7, 2016, 05:21 PM
Last activity: May 12, 2022, 09:55 PM
Last activity: May 12, 2022, 09:55 PM