8 tests - Show all attributes of the given files which can be tested by test(1) in the same color as ls(1) shows them
22 echo "${0##*/} [-nc] [-s mark] [-F] <files>
23 Displays files /directories/ details reported by test(1)
25 -s CHAR put CHAR after filenames, instead of semicolon
26 -F don't output filenames"
42 if [ $color = yes ]; then
61 # determine colors bases on LS_COLORS
64 for typecolor
in $LS_COLORS; do
66 color
="\e[${typecolor/*=}m"
106 #for line in `cat`; do
125 if [ -e "$line" ]; then
126 [ -b "$line" ] && bs
=y
127 [ -c "$line" ] && cs
=y
128 [ -d "$line" ] && d
=y
129 [ -L "$line" ] && l
=y
130 [ -f "$line" ] && rf
=y
131 [ -g "$line" ] && sgid
=y
132 [ -u "$line" ] && suid
=y
133 [ -G "$line" ] && g
=y
134 [ -O "$line" ] && o
=y
135 [ -k "$line" ] && st
=y
136 [ -s "$line" ] && gtz
=y
137 [ -r "$line" ] && r
=y
138 [ -w "$line" ] && w
=y
139 [ -x "$line" ] && x
=y
140 [ -S "$line" ] && so
=y
141 [ -p "$line" ] && pi
=y
143 if [ -n "$r" -a -z "$w" ]; then
145 elif [ -n "$r" -a -n "$w" ]; then
148 res
="${UNREAD}unreadable${NO}"
150 if [ -n "$rf" -a -z "$gtz" ]; then res
="$res ${NO}empty${NO}"; fi
151 if [ -n "$x" -a -z "$d" ]; then res
="$res ${X}executable${NO}";
152 elif [ -n "$x" ]; then res
="$res ${X}browsable${NO}"; fi
153 [ -n "$bs" ] && res
="$res ${BS}block_special${NO}"
154 [ -n "$cs" ] && res
="$res ${CS}character_special${NO}"
155 [ -n "$so" ] && res
="$res ${SO}socket${NO}"
156 [ -n "$pi" ] && res
="$res ${PI}named_pipe${NO}"
157 [ -n "$d" ] && res
="$res ${DIR}directory${NO}"
158 [ -n "$l" ] && res
="$res ${SL}symbolic_link${NO}"
159 [ -n "$rf" ] && res
="$res ${RF}regular_file${NO}"
160 [ -n "$sgid" ] && res
="$res ${SGID}set_group_ID${NO}"
161 [ -n "$suid" ] && res
="$res ${SUID}set_user_ID${NO}"
162 [ -n "$g" ] && res
="$res ${NO}owned_by_EGID${NO}" # ${SGID}
163 [ -n "$u" ] && res="$res ${SUID}owned_by_EUID
${NO}"
164 [ -n "$st" ] && res="$res ${STICKY}set_sticky_bit
${NO}"
166 res="${NONE}nonexistent
${NO}"
169 if [ $filenames = yes ]; then
170 res="${NO}${line}${sem} $res${NO}"