SCIENTIFIC-LINUX-USERS Archives

July 2007

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Keith Lofstrom <[log in to unmask]>
Reply To:
Date:
Fri, 13 Jul 2007 20:33:59 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (30 lines)
A cute trick for bash and xterm:

I work with a lot of xterms.  For years, I have been using pwd,
cd, and mouse-cut-and-paste to copy the working directory from
one window to another. 

Now I have a better way, involving some aliases in .bashrc:

  alias sd='pwd > ~/.sd'
  alias ds='cd `cat ~/.sd`'

I type 'sd' in the xterm I want to copy the working directory
from, and 'ds' in the xterm that I want to copy the working
directory to.

It is actually secure - the backtick'ed cat feeds directly
to cd, so even if .sd is corrupted somehow, it cannot 
execute arbitrary code.

I use 'sd' and 'ds' because I am left handed;  'kl' and 'lk' 
might be easier for right handers, and I will humbly accept
the honor of being immortalized in the initials.  ;-)

Keith

-- 
Keith Lofstrom          [log in to unmask]         Voice (503)-520-1993
KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs

ATOM RSS1 RSS2