October 12, 201510 yr root@storage:~# newperms /mnt/user/downloads/Folder\ 5/ /mnt/user/downloads/Folder 5/ /usr/local/sbin/newperms: line 21: [: /mnt/user/downloads/Folder: binary operator expected completed, elapsed time: 00:00:00 root@storage:~# newperms /mnt/user/downloads/Folder\ 5/ /mnt/user/downloads/Folder 5/ processing /mnt/user/downloads/Folder 5/ ... chmod -R u-x,go-rwx,go+u,ugo+X /mnt/user/downloads/Folder 5/ ... chown -R nobody:users /mnt/user/downloads/Folder 5/ ... sync completed, elapsed time: 00:00:02 Wrapping $1 on line 21 seems to fix this. if [ -d $1 ] ; then if [ -d "$1" ] ; then I found this issue because despite the major change, I still constantly fight with permissions and constantly have to use newperms.
February 9, 201610 yr This is still an issue. Here is a bug report in the preferred format, if that helps: unRAID OS Version: 6.1.7. Based on the date of the original report, it was introduced in 6.1.3 or earlier. Description: newperms does not work on directories with spaces in the name How to reproduce: call newperms on a directory with spaces newperms /mnt/user/share/directory with spaces/ Expected results: the permissions on the files in the directory would be changed Actual results: /usr/local/sbin/newperms: line 21: [: too many arguments Other information: Line 21 is: if [ -d $1 ] ; then but it should be: if [ -d "$1" ] ; then All of the other instances of $1 in the script are already surrounded by quotes.
Archived
This topic is now archived and is closed to further replies.