dotly icon indicating copy to clipboard operation
dotly copied to clipboard

dot command error: "find: -perm: /+111: illegal mode string"

Open alexgraupera opened this issue 3 years ago • 5 comments

When I run the dot command I get the error find: -perm: / + 111: illegal mode string and the dot (fzf) contextual help shows empty

Code location: https://github.com/CodelyTV/dotly/blob/9b11497e19f7d6b3ce4c54463b7d3d2f05e4518e/scripts/core/dot.sh#L28

If I try removing the "/" character from "-perm" parameter the find command is executed without errors and return the right information (scripts path)

dotfiles installed and executed in macOS BigSur v11.6

alexgraupera avatar Sep 28 '21 16:09 alexgraupera

I think I found the issue cause.

For some reason I was not using the gfind of the findutils installed from homebrew

Solved running this command: ln -sf ../Cellar/findutils/4.8.0_1/bin/gfind /usr/local/bin/find

With this gfind version the slash "/" char in -perm parameter works fine

Is there a way to fix all possible problems with homebrew installations symlinks? I tried with a brew upgrade or brew upgrade findutils but it didn't work

alexgraupera avatar Sep 28 '21 19:09 alexgraupera

fixed for my with ln command ln -sf /usr/local/Cellar/findutils/4.9.0/bin/gfind /usr/local/bin/find

I think the problem is because there is not exist gfind inside /opt/homebrew/bin/ so the default configuration provided of the symbolic links is not valid.

3d24rd0 avatar Jun 13 '22 21:06 3d24rd0

Not all installations of Brew have the same path... A solution could be:

brew unlink findutils
brew link findutils 

If you want the findutils path: brew --prefix findutils would be better or use HOMEBRE_PREFIX

gtrabanco avatar Jun 14 '22 21:06 gtrabanco

on a new installation I solved it by replacing

path+=(
"paths"
)

for

path=(
"paths"
$path
)

3d24rd0 avatar Jul 07 '22 21:07 3d24rd0

interestingly, if I try to patch my dotly with https://github.com/CodelyTV/dotly/pull/220 it doesn't work. I have to remove the / parameter.

◼ mbertamini:homebrew /bin/ stable ◍ $ pwd
/opt/homebrew/bin
◼ mbertamini:homebrew /bin/ stable ◍ $ ls -al | grep -i gfind
lrwxr-xr-x    1 mbertamini  admin    35 Sep 13 11:41 gfind -> ../Cellar/findutils/4.9.0/bin/gfind

brtbrt avatar Sep 13 '22 09:09 brtbrt

I'm having the same problem. Shouldn't this be fixed in the repo? #220 solves it for me but I don't see any progress on that PR

Ceres6 avatar Nov 11 '22 13:11 Ceres6

I have the same issue and I think the problem is the version of find command that is been used.

Without make any change:

<▸> ~ which find
/usr/bin/find
<▸> ~ ls -lah /usr/bin/ | grep find
-rwxr-xr-x    1 root   wheel   199K 28 oct 10:43 find

The find command aims to /usr/bin/find


After applying the changes made in #220 PR:

<▸> ~ which find
/Users/username/bin/find
<▸> ~ ls -lah ~/bin | grep find
lrwxr-xr-x   1 username  staff    23B  4 dic 02:20 find -> /opt/homebrew/bin/gfind

So, for fixing this issue I think you need to made the changes needed to use gfind installed by Homebrew instead of the default one store in /usr/bin/find. (In my case, is aplying the changes in #220)

Why some of us have this issue and is not set the correct version of find by default? Who knows 🤷‍♂️

fabriziofs avatar Dec 06 '22 02:12 fabriziofs

as @fabriziofs says, that fixed the issue 😉

brtbrt avatar Dec 09 '22 12:12 brtbrt

Closing since it's fixed in https://github.com/CodelyTV/dotly/pull/220 🙂

Thanks everybody for reporting and fixing!

rgomezcasas avatar Jan 26 '23 22:01 rgomezcasas