8862353e90cea2387f87c47065b06bab8f818a9d
[platform/upstream/coreutils.git] / tests / ls / symlink-slash
1 #!/bin/sh
2 # Do dereference a symlink arg if its name is written with a trailing slash.
3
4 if test "$VERBOSE" = yes; then
5   set -x
6   ls --version
7 fi
8
9 . $srcdir/../envvar-check
10 . $srcdir/../lang-default
11
12 tmp=t-ls.$$
13
14 framework_failure=0
15 mkdir $tmp || framework_failure=1
16 cd $tmp || framework_failure=1
17
18 mkdir dir || framework_failure=1
19 ln -s dir symlink || framework_failure=1
20
21 if test $framework_failure = 1; then
22   echo 'failure in testing framework'
23   exit 1
24 fi
25
26 fail=0
27 set `ls -l symlink/`
28
29 # Prior to fileutils-4.0k, the following would have output `... symlink -> dir'.
30 test "$*" = 'total 0' && : || fail=1
31
32 cd ..
33 rm -rf $tmp
34
35 exit $fail