Lines Matching +full:out +full:- +full:file
3 [ -f testing.sh ] && . testing.sh
5 if [ "$(id -u)" -ne 0 ]
13 GRP="$(sed -n '$s/:.*//p' /etc/group)"
14 # Or if that fails, assume we're on Android and pick a well-known group.
19 rm -rf testdir &&
20 mkdir -p testdir/dir/dir/dir testdir/dir2 &&
21 touch testdir/dir/file &&
22 ln -s ../dir/dir testdir/dir2/dir &&
23 ln -s ../dir/file testdir/dir2/file || exit 1
27 IN="cd testdir && chgrp -R $GRP dir dir2 &&"
28 OUT="&& cd .. && echo \$(ls -lR testdir | awk '{print \$4}')"
30 # The groups returned by $OUT are, in order:
31 # dir dir2 dir/dir dir/file dir/dir/dir dir2/dir dir2/file
36 testing "dir" "$IN chgrp root dir $OUT" \
38 testing "file" "$IN chgrp root dir/file $OUT" \
40 testing "dir and file" "$IN chgrp root dir dir/file $OUT" \
44 testing "symlink->file" "$IN chgrp root dir2/file $OUT" \
46 testing "symlink->dir" "$IN chgrp root dir2/dir $OUT" \
48 testing "-h symlink->dir" "$IN chgrp -h root dir2/dir $OUT" \
51 # What does -h do (affect symlink, not target)
52 testing "-h symlink->file" "$IN chgrp -h root dir2/file $OUT" \
54 testing "-h symlink->dir" "$IN chgrp -h root dir2/dir $OUT" \
57 # chgrp -R (note, -h is implied by -R)
59 testing "-R dir" "$IN chgrp -R root dir $OUT" \
61 testing "-R dir2" "$IN chgrp -R root dir2 $OUT" \
63 testing "-R symlink->dir" "$IN chgrp -R root dir2/dir $OUT" \
65 testing "-R symlink->file" "$IN chgrp -R root dir2/file $OUT" \
68 # chgrp -RP (same as -R by itself)
70 testing "-RP dir2" "$IN chgrp -RP root dir2 $OUT" \
72 testing "-RP symlink->dir" "$IN chgrp -RP root dir2/dir $OUT" \
74 testing "-RP symlink->file" "$IN chgrp -RP root dir2/file $OUT" \
77 # chgrp -RH (change target but only recurse through symlink->dir on cmdline)
79 testing "-RH dir2" "$IN chgrp -RH root dir2 $OUT" \
81 testing "-RH symlink->dir" "$IN chgrp -RH root dir2/dir $OUT" \
83 testing "-RH symlink->file" "$IN chgrp -RH root dir2/file $OUT" \
86 # chgrp -RL (change target and always recurse through symlink->dir)
88 testing "-RL dir2" "$IN chgrp -RL root dir2 $OUT" \
90 testing "-RL symlink->dir" "$IN chgrp -RL root dir2/dir $OUT" \
92 testing "-RL symlink->file" "$IN chgrp -RL root dir2/file $OUT" \
95 # -HLP are NOPs without -R
96 testing "-H without -R" "$IN chgrp -H root dir2/dir $OUT" \
98 testing "-L without -R" "$IN chgrp -L root dir2/dir $OUT" \
100 testing "-P without -R" "$IN chgrp -P root dir2/dir $OUT" \
103 rm -rf testdir