1998-02-27 07:54:42 +03:00
|
|
|
#! /bin/sh
|
2000-04-12 13:25:07 +04:00
|
|
|
|
|
|
|
# Based on previous version of lslR
|
|
|
|
# Modified by Tomas Novak <tnovak@ipex.cz> April 2000
|
|
|
|
# (to allow spaces in filenames)
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
ZCAT="gunzip -c"
|
2000-04-12 13:25:07 +04:00
|
|
|
CAT="cat"
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2000-04-12 13:25:07 +04:00
|
|
|
mclslRfs_list () {
|
1998-02-27 07:54:42 +03:00
|
|
|
case "$1" in
|
2000-04-12 13:25:07 +04:00
|
|
|
*.gz) MYCAT="$ZCAT";;
|
|
|
|
*.z) MYCAT="$ZCAT";;
|
|
|
|
*.Z) MYCAT="$ZCAT";;
|
|
|
|
*) MYCAT="$CAT";;
|
1998-02-27 07:54:42 +03:00
|
|
|
esac
|
2000-04-12 13:25:07 +04:00
|
|
|
|
|
|
|
$MYCAT "$1" | gawk '
|
1998-02-27 07:54:42 +03:00
|
|
|
BEGIN { dir="" }
|
|
|
|
/^total\ [0-9]*$/ { next }
|
|
|
|
/^$/ { next }
|
2000-04-12 13:25:07 +04:00
|
|
|
/^[^[:blank:]].*:$/ {
|
|
|
|
if ($0 ~ /^\//) dir=substr($0, 2);
|
|
|
|
else dir=$0;
|
|
|
|
if (dir ~ /\/:$/) sub(/:$/, "", dir);
|
|
|
|
else sub(/:$/, "/", dir);
|
|
|
|
next;
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
{
|
2000-04-12 13:25:07 +04:00
|
|
|
printf "%s %3d %-8s %-8s %8d %3s %2d %5s %s", $1, $2, $3, $4, $5, $6, $7, $8, dir
|
|
|
|
for (i=1; i<9; i++) sub("[^[:blank:]]+[[:blank:]]+", "");
|
|
|
|
printf "%s\n", $0
|
1998-02-27 07:54:42 +03:00
|
|
|
}' 2>/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
2000-04-12 13:25:07 +04:00
|
|
|
list) mclslRfs_list "$2"; exit 0;;
|
1998-02-27 07:54:42 +03:00
|
|
|
esac
|
|
|
|
exit 1
|