]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Don't expect `ARGV_0=$0 exec ...' to work.
authorJim Meyering <jim@meyering.net>
Fri, 19 Jul 2002 21:35:48 +0000 (21:35 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 19 Jul 2002 21:35:48 +0000 (21:35 +0000)
It doesn't work with /bin/sh of Solaris5.6.
Use an explicit `export ARGV_0' instead.
[comparing actual and expected output]: Don't match the entire line,
but rather just the `rm: cannot remove `$dir/$f':' part.

tests/rm/fail-eperm

index b1293cd779a97687d4a6f99b8ab9a16076cd1d19..7fa9c96f7c28b281996221e8707b2b095ac8c7a0 100755 (executable)
@@ -13,7 +13,10 @@ case "$PERL" in
   exit 77
   ;;
 esac
-ARGV_0=$0 exec $PERL -w -- - << \EOP
+ARGV_0=$0
+export ARGV_0
+
+exec $PERL -w -- - << \EOP
 require 5.003;
 use strict;
 
@@ -71,11 +74,11 @@ foreach my $dir (@dir_list)
              or die "$ME: unexpected exit status from `$cmd';\n"
                . "  got $status, expected 1\n";
 
-           my $exp = "rm: cannot remove `$dir/$f': Operation not permitted\n";
-           $line eq $exp
+           my $exp = "rm: cannot remove `$dir/$f':";
+           $line =~ /^$exp/
              or die "$ME: unexpected dignostic from `$cmd';\n"
                . "  got      $line"
-               . "  expected $exp";
+               . "  expected $exp ...\n";
 
            last;
          }