路径名失败的Bash脚本

时间:2013-06-29 23:25:25

标签: macos bash shell

我正在使用以下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!

注意我在“Prostock”之后使用和不使用反斜杠将$ DEST包装在单引号和双引号中并得到相同的错误。

建议最感激!

1 个答案:

答案 0 :(得分:1)

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

chmod -R +a "user:icadmin inherited allow...." "$DEST"