executability.test
来自「Rsync 3.0.5 source code」· TEST 代码 · 共 48 行
TEST
48 行
#! /bin/sh# This program is distributable under the terms of the GNU GPL (see# COPYING).# Test the --executability or -E option. -- Matt McCutchen. $srcdir/testsuite/rsync.fns# Put some files in the From directorymkdir "$fromdir"cat <<EOF >"$fromdir/1"#!/bin/shecho 'Program One!'EOFcat <<EOF >"$fromdir/2"#!/bin/shecho 'Program Two!'EOFchmod 1700 "$fromdir/1" || test_skipped "Can't chmod"chmod 600 "$fromdir/2"$RSYNC -rvv "$fromdir/" "$todir/"check_perms "$todir/1" rwx------ 1check_perms "$todir/2" rw------- 1# Mix up the permissions a bitchmod 600 "$fromdir/1"chmod 601 "$fromdir/2"chmod 604 "$todir/2"$RSYNC -rvv "$fromdir/" "$todir/"# No -E, so nothing should have changedcheck_perms "$todir/1" rwx------ 2check_perms "$todir/2" rw----r-- 2$RSYNC -rvvE "$fromdir/" "$todir/"# Now things should have happened!check_perms "$todir/1" rw------- 3check_perms "$todir/2" rwx---r-x 3# Hoorayexit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?