Linux csh script going to Suspended (tty output) when running with & (bg)
i have strange behavior i have csh file that run java process something like this :
run_server.csh
when i run it like this :
in the putty shell in linux
im getting this massage :
Although when i run it without the ampersand the server is running and outputting its log massages into the stdout but the problem is when i press ctr+c the process is killed
another strange thing is if i write wrapper script to run_server.csh
that looked like this run_server_wrapper.csh:
it does run the server as bg process and the run_server_wrapper.csh it self
getting the massage :
what is the problem here ?
Last edited by Corona688; 08-07-2014 at 12:45 PM..
If a background process tries to read from the terminal, it will be stopped. This is normal terminal and shell behavior. Only foreground processes are allowed to control the terminal like that.
To prevent it from reading from the terminal, run it with nohup to prevent it from accessing the terminal. This will redirect stdin/stdout/stderr automatically. stdin will connect to /dev/null, while stdout and stderr will be saved to a file in the current directory.
I am using an awk command to extract a particular portion of a string. Below is the command and its output on a Linux system:
oracle@host1:/tmp (/home/oracle)
$uname -a
Linux host1 2.6.32-279.39.1.el6.x86_64 #1 SMP Fri Nov 15 05:38:26 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
... (7 Replies)
I'm having a strange problem with basic >& output redirection to a simple log file in csh. When I run this particular output redirection on the command line, it works, but then when I run the same output redirection command >& in my c shell script, I get a blank log file. Nothing is output to the... (5 Replies)
Hi All,
I have a requirement where i need to NDM 3 files from LINUX to Mainframe system & trigger a job in mainframe once the 3 files are transmitted successfully.
I am getting an error message in the && operator (the code component where i am checking whether step 1/2/3 are completed).
... (2 Replies)
Hi,
I need your help to understand about different processes(tty1,tty2,tty3...) running as root as shown below .What exactly these processes do?
root@bisu-desktop:~# ps -eaf | grep -e tty -e UID
UID PID PPID C STIME TTY TIME CMD
root 761 1 0 10:30 tty5 ... (4 Replies)
I am trying to find the number of files whose name starts with uni.
Below is the code but it is giving error. :confused:
#!/bin/csh
FILES_NAME ='files_list';
FILE_NAME_PATTERN = 'uni*';
NO_OF_FILES;
ls -l $FILE_NAME_PATTERN > $FILES_NAME ;
NO_OF_FILES = `wc -l $FILES_NAME`;
echo... (3 Replies)
I am having hard time understanding what this really do to the environment? I do understand this part "tty -s && stty " but not "istrip"
# stty command is executed only if a tty is attached to the process.
# stty istrip : Strip input characters to 7 bits
tty -s && stty istrip
I am... (3 Replies)
I have a simple csh-script on a Solaris Workstaion which invokes the bc calculator:
#!/bin/csh
set shz=2
set zshift=5
set shzp=`bc -l <<END \
scale = 3 \
-1. * $shz + $zshift \
END`
echo $shzp
The result ($shzp) in this case is 3 (-1*2+5). It works fine on Solaris 8.
... (2 Replies)
I have been trying to get the output of an ssh session pushed to file... the problem is that there are colors in the output, and when I view the file the colors show up as "^[00m" or other such various nonsense
The weird part is that if I do this all manually, I have no problems, but if I try to... (0 Replies)