0

我正在使用以下 Bash 脚本,但收到以下愚蠢错误:

Fixing perms on /Volumes/Volume-B/IMAGES/Prostock scans/
chmod: Failed to set ACL on file '/Volumes/Volume-B/IMAGES/Prostock': No such file or directory
chmod: Failed to set ACL on file 'scans/': No such file or directory
chmod: Unknown tag type 'inherited'

这是我的脚本:

#!/bin/bash

PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH
DEST=/Volumes/Volume-B/IMAGES/Prostock\ scans/

echo Fixing perms on $DEST
chmod -R +a "user:administrator allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" $DEST 

chmod -R +a "user:icadmin inherited allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown,file_inherit,directory_inherit" $DEST

echo Done!

请注意,我已将 $DEST 用单引号和双引号括起来,在“Prostock”之后带有和不带反斜杠,并得到相同的错误。

建议最赞赏!

4

1 回答 1

1

$DEST您是否尝试在变量周围加上双引号?

chmod -R +a "user:icadmin inherited allow...." "$DEST"
于 2013-06-29T23:29:26.703 回答