From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Content-Type: Multipart/Mixed; charset="koi8-r"; boundary="------------Boundary-00=_NH2EUG9D5S1232HA1OBB" From: Sergei To: mandrake-russian@altlinux.ru X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Message-Id: <01060408441100.13885@pif.b5.mephi.ru> Subject: [mdk-re] =?koi8-r?b?883FzsE=?= =?koi8-r?b?0NLB1w==?= Sender: mandrake-russian-admin@altlinux.ru Errors-To: mandrake-russian-admin@altlinux.ru X-BeenThere: mandrake-russian@altlinux.ru X-Mailman-Version: 2.0 Precedence: bulk Reply-To: mandrake-russian@altlinux.ru List-Help: List-Post: List-Subscribe: , List-Id: Linux-Mandrake RE / ALT Linux discussion list List-Unsubscribe: , List-Archive: Date: Mon Jun 4 08:28:01 2001 X-Original-Date: Mon, 4 Jun 2001 08:44:11 +0400 Archived-At: List-Archive: List-Post: --------------Boundary-00=_NH2EUG9D5S1232HA1OBB Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 8bit Как-то пробегало сообщение о смене прав. Хочу предложить скрипт смены прав у файлов и каталогов рекурсивно и при этом различает права для каталогов и файлов. -- С уважением, Епифанов Сергей --------------Boundary-00=_NH2EUG9D5S1232HA1OBB Content-Type: text/plain; charset="koi8-r"; name="chsub" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="chsub" #!/bin/sh if [ "$4" != "sub" ] then if [ x"$4" != x ] then echo "ERROR: in parameters" exit 10 fi echo "(C) PIF 2000" echo "Change permissions for subdirectories" echo " " fi dirmode=$1 filemode=$2 dirpath=$3 if [ "$4" != "sub" ] then if [ x"$dirpath" == x ] then echo "This program will change access mode for directories and files recursively" echo "Usage: chsub dirmode filemode dir" echo " dirmode - directory mode" echo " filemode - file mode" echo " dir - the name of the directory or file" echo " " echo "Example: chsub /tmp 755 644" exit 0 fi fi if [ $# -le 2 ] then echo "ERROR: in parameters" echo "Type chsub for help" exit 1 fi if [ -e "$dirpath" ] then chmod $dirmode "$dirpath" else echo "ERROR: $dirpath does not exists!" exit 11 fi if [ $? -ne 0 ] then echo "ERROR: in chmod" exit 2 fi for i in `ls -1a "$dirpath"` do if [ "$i" != "." ] then #Skip file "." if [ "$i" != ".." ] then #Skip file ".." if [ -d "$dirpath/$i" ] then #If $dirpath/$i is a directory echo "Directory $dirpath/$i" chmod "$dirmode" "$dirpath/$i" >/dev/null 2>&1 $0 "$dirpath/$i" "$dirmode" "$filemode" sub else #if $dirpath/$i is not a directory echo " File $dirpath/$i" chmod "$filemode" "$dirpath/$i" >/dev/null 2>&1 fi fi fi done --------------Boundary-00=_NH2EUG9D5S1232HA1OBB--