Improve performance of fixpermissions function

I’d like to have a function like this that only has to search the folder once instead of three times to do it’s job.

# Fixes permissions for files and directories in the given folder or the current folder
function fixpermissions() {
    find "${1:-.}" -type f -executable -exec chmod 744 {} \;
    find "${1:-.}" -type f ! -executable -exec chmod 644 {} \;
    find "${1:-.}" -type d -exec chmod 755 {} \;

I’m not sure I condone it … but you can place things like this in your .bashrc or .zshrc

I know I can have functions in my .zshrc, is where I have this one. I don’t understand why you said that.

I see. I guess I did not read carefully.

PS - Consider using {} + instead as it should be a good stretch faster.

Housekeeping … no activity …