]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
*** empty log message ***
authorJim Meyering <jim@meyering.net>
Wed, 13 Dec 2000 22:25:42 +0000 (22:25 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 13 Dec 2000 22:25:42 +0000 (22:25 +0000)
tests/chgrp/deref

index 0134d091b93edb90213ac269373b02396569c640..6b7c47001aa34b5884266f23c05d57babe2487a3 100755 (executable)
@@ -35,8 +35,6 @@ set _ $groups; shift
 g1=$1
 g2=$2
 
-fail=0
-
 touch f
 ln -s f symlink
 
@@ -51,25 +49,28 @@ EOF
   (exit 77); exit
 }
 
-(
-  chgrp -c $g1 f
-  chgrp $g2 symlink 2> /dev/null
-  # This should not change the group of f.
-  chgrp -c $g2 symlink 2> /dev/null
-  chgrp -c $g2 f
+fail=0
+
+chgrp $g1 f
+set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1
 
-  # This *should* change the group of f.
-  # Though note that the diagnostic is misleading in that
-  # it says the `group of `symlink'' has been changed.
-  chgrp --dereference -c $g1 symlink
-) 2>&1 | sed "s/ $g1$/ G1/;s/ $g2$/ G2/" > actual
+chgrp $g2 symlink || fail=1
+set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1
 
-cat <<\EOF > expected
-group of `f' changed to G2
-group of `symlink' changed to G1
-EOF
+# This should not change the group of f.
+chgrp $g2 symlink || fail=1
+set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1
+
+chgrp $g2 f
+set _ `ls -l f`; g=$5; test "$g" = $g2 || fail=1
 
-cmp expected actual \
-  || { diff -u expected actual 1>&2; fail=1; }
+# This *should* change the group of f.
+# Though note that the diagnostic is misleading in that
+# it says the `group of `symlink'' has been changed.
+chgrp --dereference $g1 symlink
+set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1
 
 (exit $fail); exit