Just for clarification, if you are only going to use it once, there is no need to capture it in a variable.
Of course, the kill command expects a command-line argument, not standard input; xargs arranges things suitably, so you could say that's how you "pipe it to kill".
Equivalently, you could use backticks:
Notice, those are backticks (ASCII 96), not regular quotes.
You should probably start a different thread about your "last" question, but basically, the idiom for counting things is "pipe to | sort | uniq -c" (and maybe | sort -rn to top it off, to get the ones with the biggest number of hits first).
Hello,
First let me start by saying I have searched the forum and read all the SUID stuff but it is not in the neighborhood I am looking for.
Here is the problem. We want to grant a non super-user permission to kill root processes but only if the process matches certain criteria. ... (8 Replies)
Dear All:
I use sun OS system and write a code in c as folloing
purpose kill textedit program,but i get some error
please give me a great help Thanks.
#include <stdlib.h>
int main()
{
const char cTestPrag=" kill -9 `ps -ef | grep textedit | grep -v "grep"| awk '{print $2}'| xargs` ";
... (6 Replies)
Hi,
I know that the answer to this is very simple, since I saw somebody do it some time back..but I forgot how.
The problem is, I have multiple instances of the same program running simultaneously and I want to kill them all in a single command.
I know that it can be done using awk '{print... (12 Replies)
I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Hi,
i want to write a script that executes a program (exec?) .
this program then requires a filename as input.
how do i give it this input in the script so the program will be complete run and close by the script.
e.g.
exec prog.exe
program then asks for filename
"enter filename:"... (1 Reply)
Dear All,
I have a script which after executing is not stoping when i press ctrl+c.
Now i want to Append the script in such a way when i press ctrl+c while execution of the program it should take it as arguements and should kill the script/running program forcefully.
I know the command to... (1 Reply)
I have my Mac OS X program executing a shell script (a script that copies files to a drive). I want to make it so that the shell script automatically kills itself if it finds that the host .app is not running OR kill itself if the drive that it is copying files to has been unmounted. Right now what... (2 Replies)
Hello
i'm trying to make a program which can find a running program on the system and kill it, then repeat that every 5 minutes. The name of the process is given with an argument. I have done this so far, but still not working.
if $1 in $(ps -e) ; then
kill $(pidof $1)
sleep 5m
fi (3 Replies)
to kill a program in bash, for instance 'mousepad' I use
kill $(pidof mousepad);
or
pkill mousepad
But it only works if we use another bash window;
If it is started from the same bash, that does not work:
#mousepad;kill $(pidof mousepad);
In this case, it looks like mousepad hangs... (7 Replies)
Discussion started by: arpagon
7 Replies
LEARN ABOUT MINIX
join
JOIN(1) General Commands Manual JOIN(1)NAME
join - relational database operator
SYNOPSIS
join [-an] [-e s] [-o list] [-tc] file1 file2
DESCRIPTION
Join forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. If file1 is `-', the standard
input is used.
File1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in
each line.
There is one line in the output for each pair of lines in file1 and file2 that have identical join fields. The output line normally con-
sists of the common field, then the rest of the line from file1, then the rest of the line from file2.
Fields are normally separated by blank, tab or newline. In this case, multiple separators count as one, and leading separators are dis-
carded.
These options are recognized:
-an In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2.
-e s Replace empty output fields by string s.
-o list
Each output line comprises the fields specified in list, each element of which has the form n.m, where n is a file number and m is a
field number.
-tc Use character c as a separator (tab character). Every appearance of c in a line is significant.
SEE ALSO sort(1), comm(1), awk(1).
BUGS
With default field separation, the collating sequence is that of sort -b; with -t, the sequence is that of a plain sort.
The conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous.
7th Edition April 29, 1985 JOIN(1)