[Lug-Nuts] Oneliners

From: Mike Machado (mike@cheapnet.net)
Date: Tue Sep 21 1999 - 11:25:50 PDT


(Forward from Mike!)

I am having some mail problems so to those who wnat to reply to this, please
send mail to scream@cwo.com

Thanks

ONELINERS

Here they are

ps -ef | grep xterm | egrep -v grep | awk '{print "kill -9 " $1}' | sh

The above: Kills all xterm windows. This is usefull if you wanted to back
up
a database but wanted to make sure that no jobs were running in the
background.
 The first bit gets all the processes named xterm. The second strips out
the
process ps -ef | grep xterm. It then prints only the first column ($1) of
the
ps -ef command and echo's kill -9 "PID" to a new shell.

Here is one (below) that automatically sets your DISPLAY variable to the
hostname/ip address that you are telneting or sshing in from. Why on earth
would you want this, well I used to have users that used where not UNIX savy
and would constantly ask me show them how to run HP Openview on there
systems
from the main server. So this what i came up with. Now all the have to do
is
execute the command. This can also be usefull for any remote admin stuff
involving X apps.

export DISPLAY=`who am i | awk -F\( '{print $2}'| awk -F\) '{print $1}'`:0.0

Basically its just stripping out the ip address/hostname from the who am i
command, and then assigning it to the DISPLAY variable.

Have fun

Andrew

one liners (Brian E. Lavender, Mon Sep 20 21:34:22 1999)

Andrew,

You mentioned the one liners at the Installfest on Saturday. Are you
going to post them to the list, so we can check them out?

brian

--
Brian Lavender
http://www.brie.com/brian/



This archive was generated by hypermail 2b29 : Fri Feb 25 2000 - 14:29:07 PST