Re: [Lug-Nuts] Oneliners

From: Mike Simons (msimons@fsimons01.erols.com)
Date: Thu Sep 23 1999 - 17:21:10 PDT


On Tue, Sep 21, 1999 at 11:25:50AM -0700, Mike Machado wrote:
> ps -ef | grep xterm | egrep -v grep | awk '{print "kill -9 " $1}' | sh

  kill -9 `ps aux | awk '/xterm/ { print $1 }'`
  killall -9 xterm # if you system supports this

> The above: Kills all xterm windows.
[...]
> Here is one (below) that automatically sets your DISPLAY variable to the
> hostname/ip address that you are telneting or sshing in from.

  ...just a note: ssh automatically redirects X data through an encrypted
channel back to the machine that ssh'd in and is smart enough to redirect
through multiple sites (if you got through three ssh'es the data will be
redirected through three encrypted channels). So you shouldn't use (or need)
this one liner when using ssh.
 
> export DISPLAY=`who am i | awk -F\( '{print $2}'| awk -F\) '{print $1}'`:0.0

... also 'who am i' prints out data in a different format on my machine:
  gabriel!msimons tty7 Sep 22 11:11

so I wasn't able to play with that command...

  Later,
    Mike Simons



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