What RudiC is trying to show you is the following: you have one script:
Quote:
Originally Posted by jakefish
And in another script you call it and put it in the background:
Quote:
Originally Posted by jakefish
In fact you need to take out your comments or at least put the "&" before the comment signs, otherwise it is just part of the comment, but that only as an aside. So, in fact, you have:
The line i marked bold is where you call the first script, right?
Now, a script is basically a list of commands, bput together into a file. You can do that inside a shell too, using what is called "process substitution". You write ( .... ) and what is inside the braces is considered one command to the outside. You can redirect its input or output and everything else you do with a separate script - and that includes putting it in the background:
Notice that "%" is using the job control of the shell: if you have background jobs they are assigned consecutive small numbers which you can list with the jobs command. You can address the processes using these small numbers instead of their PIDs.
Furthermore notice that there is a difference between "process substitution" (( ... )) and "command substitution" ($( ... )) as they are easily confused. They (can) serve similar purposes but are different things.
You should NOT use killall anyway, because this sends signal 9 to the process(es). You should always try signal 15 first and only use signal 9 if that doesn't work.
I hope this helps.
bakunin
These 2 Users Gave Thanks to bakunin For This Post:
Now I am just getting frustrated and confused... if anyone has some advice on how this anomoly is occurring I would greatly appreciate it.
cat helpme.txt | awk 'NR<5{printf("%-20s %-20d %-20d %-20.1f\n","hello",$1,$2,$3)}' | sort -rk4
This line works fine in solo - reads the three fields from... (4 Replies)
Hi,
I want a command in unix shell script which will exit my whole program, not only from the function it's using. For e.g:
$1 == "m_who" && $4 == "Extrnl Vendor" {
print "You don have access"
exit (0);
}
If this error is showing on the screen, then nothing should not... (9 Replies)
hi
while executing the following script, my terminal window is getting closed if I enter a invalid option. I want the script should go back the the command prompt. how to do achive it. i execute the script as . ./test
#! /usr/bin/ksh
Printf " Type of Installer : \n\t\t 1. Whole Build... (3 Replies)
This is a fairly complex issue. I do not have a lot of knowledge on X11. But here are the things.
I am running a program called Synergy off a Solaris server. The server sits in a remote network and can be accessed via NAT. Using Putty, I will enable X11 forwarding and launch Synergy via Putty.... (0 Replies)
hi All
I have a scritp running which connects to a local host and then gets a value from a field and then ftp that value to antoher server. It is running fine, and from crontab it gives the output to a file, the problem is sometime it doesnt run but if i check the output file it does not show one... (0 Replies)
Hey , guys I am new to shell programing ,, so need a help from you guys ...
I have to write a shell script that accepts file name or directory name from the user if it is a directory then throw an error if it is a file then give the user two options .
1.overwrite the content
2.append the... (2 Replies)
Greetings, I have a C-program that is made to implement a hidden Markov model on an input file. The program is very memory intensive.
I've installed it on my local server where I have an account and it compiles fine. The way they have the server set up is that you can either work... (1 Reply)
REALLY new to this stuff, sorry.
So I want a shell script to open a program, wait 45 minutes, close it, and then do it all again. I want to do this because I am running an iMacros Script for a long period of time and if Firefox is not constantly restarted, memory leaks start to happen.
Anyway... (6 Replies)
I have a file with two line, one is header, the other actual value:
TYPCD|ETID2|ETID|LEG ID|PTYP|PTYP SUB|TRD STATUS|CXL REASON|CACT|CACTNM|ENCD|ENC
D NM|TRDR|ASDT|TRDT|MTDT|STDT|LS|SECID|SECID TYP|SECNM|PAR|STCC|MARKET PRICE|DIS
MARKET PRICE|MARKET PRICE CURRENCY|SRC OF SETTLEMENT... (2 Replies)
Hello all..
so i have a problem i need to solve ..
#! /bin/bash
$SHELL
dtterm -title my_prog -e su -user -c 'export DISPLAY=:0.0 ; /path/to/my/prog' & 2> /dev/null
$SHELL
intr
exit
This script will work on solaris 10 system in right clikt menu - in a secure system so i need to... (0 Replies)