home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / live / usr / X11R6 / bin / cd-tkdesk < prev    next >
Text File  |  1998-10-10  |  490b  |  21 lines

  1. #!/bin/sh
  2. #
  3. # Usage: cd-tkdesk [directory]
  4. # Changes path of currently active browser to directory, or prints out
  5. # its current path if no arg is given.
  6.  
  7. if [ $# -gt 0 ]; then
  8.   DIR=$1
  9.   if [ "$DIR" = "." ]; then
  10.     DIR=`pwd`
  11.   elif [ "$DIR" = ".." ]; then
  12.     DIR=`dirname $(pwd)`
  13.   elif [ "x`echo $DIR | grep '^[/~]'`" = "x" ]; then
  14.     DIR=`pwd`/$DIR
  15.   fi
  16.   tkdeskclient "dsk_active dir $DIR" >/dev/null
  17. else
  18.   # read TkDesk's current dir from socket
  19.   tkdeskclient "dsk_active dir"
  20. fi
  21.