#!/bin/csh -f #(ie run the cshell on this but don't read the .cshrc) # nowhere: now link to here # version = 1.13 of nowhere 2008 Mar 03 TDS # 2008 Mar 03, 1.13 fix missing # in documentation # 2007 Jul 18, 1.12 Document trick from Blake Sweeney for bash use. # 2004 Jul 23, 1.11 improve documentation # 2004 Feb 8, 1.10 quote the `pwd` for MacOSX spaces in file names # 2002 Dec 1, 1.09 quote the links for MacOSX spaces in file names # 2001 August 28, 1.08 previous change # 1.06 2000 Jul 9: replace colrm with cut; more standard and modern # 1.05 2000 Jan 20: announce previous link # 1.04 1998 September 30 # Make a link from the user's ~/now directory to the current location # in the directory tree so that it is easy to get back to where the user # is working now. # documentation: # http://www.lecb.ncifcrf.gov/~toms/nowhere.html # 2007 Jul 18 # In the bash shell the jumps through the now diretory pointers # leave the pwd as still going through the pointer instead of # the absolute path. Blake Sweeney points out that # to get the pointer string in the nowhere directory: # ls -l d | awk '{ print $NF }' # This could be put into the alias for the bash when that is developed. # This function is provided by the nowherename script. # Dr. Thomas D. Schneider # National Institutes of Health # National Cancer Institute # Center for Cancer Research Nanobiology Program # Molecular Information Theory Group # Frederick, Maryland 21702-1201 # toms@ncifcrf.gov # permanent email: toms@alum.mit.edu (use only if first address fails) # http://www.ccrnp.ncifcrf.gov/~toms/ # As of 1994 Sep 2 all the now links are in the directory # ~/now. This keeps the home directory cleaner. # Note: 1994? According to my records, I invented nowhere in 1998! if !(-d ~/now) then echo "creating a directory named 'now' in your home directory" echo "all nowhere links will be there" mkdir ~/now endif # this is ok but the ~ is not activated and expanced: # set target = "~`whoami`/now" # SO: expose the ~ so that we get the user now directory: set target = ~`whoami`/now # echo $target # this is the amount of the ls text to remove: set block = 54 switch ($#argv) case 0: echo PREVIOUS LINK: # ls -l ~/now/c | colrm 1 $block ls -l ~/now/c | cut -c$block-2000 rm -f ~/now/c # protect the string in quote marks for MacOSX: ln -s "`pwd`" "$target/c" # echo "~/now/c LINK IS: " echo "CURRENT LINK:" # ls -l ~/now/c | colrm 1 $block ls -l ~/now/c | cut -c$block-2000 breaksw case 1: echo PREVIOUS LINK: # ls -l ~/now/$1 | colrm 1 $block ls -l ~/now/$1 | cut -c$block-2000 rm -f ~/now/$1 # protect the string in quote marks for MacOSX: ln -s "`pwd`" "$target/$1" # echo "~/now/$1 LINK IS: " echo "CURRENT LINK:" # ls -l ~/now/$1 | colrm 1 $block # ls -l ~/now/$1 | cut -c$block-2000 ls -l "$target/$1" | cut -c$block-2000 breaksw default: echo "nowhere needs either 0 or 1 paramter" breaksw endsw exit 2001 Aug 28 | From bryantd@ncifcrf.gov Mon Aug 27 16:02:06 2001 | From: "David Bryant" | To: Tom Schneider | Date: Mon, 27 Aug 2001 16:02:04 -0400 | Subject: Re: pointers don't work | | Do you know if I still need the bit about changing | /tmp_mnt/net/ to /home/ | anymore (it's in the nowhere script). | | /tmp_mnt/net hasn't been used since SunOS 4.x to my knowledge. | | >DEB Therefore I removed: ln -s `pwd | sed -e "s|/tmp_mnt/net/|/home/|"` \ $target/c