/var/list/.bin/showlink is in smartlist 3.15-25build1.
This file is owned by list:list, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #! /bin/sh
: &&O='cd .' || exec /bin/sh "$0" $argv:q # we're in a csh, feed myself to sh
$O || exec /bin/sh "$0" "$@" # we're in a buggy zsh
#########################################################################
# showlink Displays all links to a file #
# #
# Created by S.R. van den Berg, The Netherlands #
# #
# If you can figure out and understand everything in this script, #
# you can consider yourself an awk guru! #
#########################################################################
#$Id: showlink,v 1.6 1994/05/26 14:11:24 berg Exp $
defaults=.etc
echo=echo # /bin/echo
test=test # /bin/test
ls=ls # /bin/ls
awk=awk # /usr/bin/awk
dirname=dirname # /bin/dirname
basename=basename # /bin/basename
showlink=showlink # $HOME/.bin/showlink
EX_USAGE=64
$test 0 = $# && $echo "Usage: showlink filename ..." 1>&2 && exit $EX_USAGE
case $# in
1) if $test -d "$1"
then
cd "$1"
set dummy *
shift
$test ! -d $defaults -a -d ../$defaults && cd ..
for a in "$@"
do $ls -di $defaults/$a .bin*/$a */$a 2>/dev/null
done
else
file=`$basename "$1"`
cd=`$dirname "$1"`
$test ! -d $defaults -a -d ../$defaults && cd ..
$ls -di $defaults/$file .bin*/$file */$file 2>/dev/null
fi;;
*) $ls -di "$@";;
esac | $awk '
BEGIN {
count[0]=0;
}
{ for(start=1;substr($0,start++,1)==" ";);
fname[$1"#"(++count[$1])]=substr($0,length($1)+start);
}
END {
for(inode in count)
{ if((i=count[inode])>1)
{ bn=fname[inode"#"1];
for(start=length(bn);start>0&&"/"!=substr(bn,start,1);start--);
printf("Links to %s:\n",(bn=substr(bn,start+1)));
lbn=length(bn="/"bn);linel=0;
for(;i;i--)
{ if((lcn=length(cn=fname[inode"#"i]))>lbn)
if(substr(cn,lcn+1-lbn,lbn)==bn)
lcn=length(cn=substr(cn,1,lcn+1-lbn));
if(!linel)
printf(" >");
else if(linel+lcn>=76)
{ printf("\n >");linel=0;
}
linel+=19;
if((lcn-=18)>0)
{ linel+=lcn;linel+=lcn=19-lcn%19;
}
else
lcn=0;
if(linel>76)
linel=76;
printf("%"lcn"s %18s","",cn);
}
printf("\n");
}
}
}'
|