[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev Re: who owns what
From: |
Philip Webb |
Subject: |
Re: lynx-dev Re: who owns what |
Date: |
Fri, 9 Oct 1998 08:06:19 -0400 (EDT) |
981008 Bela Lubkin wrote:
> Below is pathto , which will show us the real situation on your system.
> It requires either ksh or bash; your SGI system probably has ksh.
CHASS has both.
> It also assumes that `ls -ld file` produces output, for symlinks,
> which looks like:
> lrwxrwxrwx 1 filbo armory 17 Oct 8 18:08 foo -> bar
> `` -> '' sequence between link source ^^^^ target
i tried to create a link as described in K & P to test this,
ie ln ~/dir/test.d1 test.d2 , where test.d1 exists in ~/dir :
it created test.d2 , but subsequent test edit changes in each file
had no effect on the other file & ls -ld test.d1 showed nothing special.
how do i create a link to test the command?
> Show us the output of `pathto $HOME`.
i tried to execute it & got syntax error in line 22: `;' expected .
> =============================================================================
>
> #!/bin/ksh
> # or:
> #!/bin/bash
> #!/bin/zsh -y
> #
> # 1997/11/21 pathto 1.0 address@hidden --
> # - created
> # 1998/10/08 pathto 1.1 address@hidden --
> # - work with color ls; bash or zsh as well as ksh
> # - handle spaces and `` -> '' in filenames
>
> pathto() {
> File="$1"
> Prefix="$2"
> case $File in
> /*) ;;
> *) File="$PWD/$File" ;;
> esac
> Path=
> echo -n "$Prefix"; $LS -ld /
> IFS=/; set -- $File; for Component; do IFS=" "
> [ "x" = "x$Component" ] && continue
> Dir="$Path"
> Path="$Path/$Component"
> Ls=$($LS -ld "$Path")
> echo -n "$Prefix"; $LS -ld "$Path"
> if [ -L "$Path" ]; then
> Link="${Ls#*$Path* -> }" ## assumes `` -> '' in `ls` symlink output
> case $Link in
> /*) ;;
> *) Link="$Dir/$Link";;
> esac
> pathto "$Link" "$Prefix "
> fi
> done
> }
>
> LS=ls
> for file; do
> pathto $file ""
> done
--
========================,,============================================
SUPPORT ___________//___, Philip Webb : address@hidden
ELECTRIC /] [] [] [] [] []| Centre for Urban & Community Studies
TRANSIT `-O----------O---' University of Toronto
Re: lynx-dev Re: who owns what, dickey, 1998/10/09