]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: chgrp: allow a numeric user id to be printed
authorCollin Funk <collin.funk1@gmail.com>
Sat, 24 Jan 2026 22:12:10 +0000 (14:12 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Sat, 24 Jan 2026 23:06:51 +0000 (15:06 -0800)
* tests/chgrp/from.sh: If 'id' cannot find a user name for user id 1,
expect the user id to be printed in the message of 'chgrp'.
Reported by Bruno Haible.

tests/chgrp/from.sh

index 49ba04fa67eb4e666362564b7728e6de46ffcfc9..4d363667668c7b5c27f755413971e4f0fcfb26b3 100755 (executable)
@@ -30,7 +30,7 @@ set _ $(ls -n f); shift; test ":$4" = ':1' || fail=1
 # Make sure the correct diagnostic is output
 # Note we output a name even though an id was specified.
 chgrp -v --from=42 43 f > out || fail=1
-printf "group of 'f' retained as $(id -nu 1)\n" > exp
+printf "group of 'f' retained as $(id -nu 1 || printf 1)\n" > exp
 compare exp out || fail=1
 
 chgrp --from=:1 010 f || fail=1