I have the following code which should put programs startable in Bash.
if [ "`uname`" = "Darwin" ]; then
compctl -f -x 'p[2]' -s "`/bin/ls -d1 /Applications/*/*.app
/Application:/*.app | sed 's|^.*/\([^/]*\)\.app.*|\\1|;s/ /\\\\ /g'`"
-- open
alias run='open -a'
fi
However, it does not work in my Zsh at all. I can open no programs with it.
Another bug which it has is that it opens all programs. I want have only programs startable which permissions is 700.
I know that you can search these programs rather well by
find -perm 700 -type f *.app
However, I could not get my find -command work exactly for each program file. This suggests me that there may be a better way to make programs startable in terminal.
How can you make programs startable in Zsh in Mac/Ubuntu?