2 # Make sure that ls -i works properly on symlinks.
4 if test "$VERBOSE" = yes; then
10 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
11 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
12 trap '(exit $?); exit $?' 1 2 13 15
15 mkdir -p $tmp || framework_failure=1
16 cd $tmp || framework_failure=1
17 touch f || framework_failure=1
18 ln -s f slink || framework_failure=1
20 if test $framework_failure = 1; then
21 echo "$0: failure in testing framework" 1>&2
27 # When listed explicitly:
29 set x `ls -Ci f slink`; shift
31 # The inode numbers should differ.
32 test "$1" != "$3" || fail=1
34 set x `ls -CLi f slink`; shift
36 # With -L, they must be the same.
37 test "$1" = "$3" || fail=1
39 set x `ls -CHi f slink`; shift
41 # With -H, they must be the same, too, from the command line.
42 # Note that POSIX says -H must make ls dereference only
43 # symlinks (specified on the command line) to directories,
44 # but the historical BSD meaning of -H is to dereference
45 # any symlink given on the command line. For compatibility GNU ls
46 # implements the BSD semantics.
47 test "$1" = "$3" || fail=1
49 # When listed from a directory:
53 # The inode numbers should differ.
54 test "$1" != "$3" || fail=1
56 set x `ls -CLi`; shift
58 # With -L, they must be the same.
59 test "$1" = "$3" || fail=1
61 set x `ls -CHi`; shift
63 # With -H, they must be different from inside a directory.
64 test "$1" != "$3" || fail=1
66 (exit $fail); exit $fail