mac notebook catalina Permission denied bash

mac notebook catalina Permission denied bash


Posted on Aug 20, 2020 2:13 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 20, 2020 11:09 AM

So your .zprofile is trying to call .bash_profile, but this file is not executable.


You could change the first line to


source ~/.bash_profile


or use chmod to give .bas_profile “execute” permission by typing in Terminal:


chmod u+x ~/.bash_profile

10 replies

Aug 20, 2020 10:30 AM in response to rudolfusa

rudolfusa wrote:

rudolf@Rudolfs-MacBook-Pro-new ~ % ls -la ~/.zprofile
-rw-r--r--@ 1 rudolf staff 18 Aug 19 12:02 /Users/rudolf/.zprofile
rudolf@Rudolfs-MacBook-Pro-new ~ % 


That seems ok.

Since there is no .zprofile created by default, I suppose you may have created or some software that you installed did.


Can you post just the first few lines of it?

They can be produced for example by typing the following in Terminal:


head -10 ~/.zprofile

Aug 20, 2020 2:16 PM in response to rudolfusa

Not every Bashism is compatible with Zsh, and just blithely attempting to source ~/.bash_profile may not result in what you are hoping. The PS1 shell prompt syntax is entirely different in Zsh than in Bash.


You could rename the ~/.zprofile to ~/.zshrc.


Here is my ~/.zshrc contents. Note that I am using homebrew and not MacPorts as a package manager and that is why my PATH is configured to look in /usr/local/bin.


# .zshrc
export PATH=".:$HOME/bin:/usr/local/bin:$PATH"
export MANPATH=".:/user/local/share/man:/usr/share/man:$MANPATH"
TPUT="/usr/bin/tput"
Bluebld="$(${TPUT} bold; ${TPUT} setaf 63)"
White="$(${TPUT} bold; ${TPUT} setaf 15)"
Green="$(${TPUT} bold; ${TPUT} setaf 42)"
Normal="$(${TPUT} sgr0)"
# don't want VPN DNS changing my hostname
MyHost="$(networksetup -getcomputername)"
export CLICOLOR=1
# [e]grep matches are quite yellow
export GREP_COLOR='00;38;5;226'
export GREP_OPTIONS='--color=auto --extended-regexp'
export LSCOLORS='gxfxcxdxbxegedabagacad'
export HOMEBREW_NO_ANALYTICS=1
PS1="%{${Green}%}${MyHost}: %~ %% %{${White}%}"
# command-line editing using vi/vim
bindkey -v
alias tt='open -a Textastic "$@"'




Aug 20, 2020 10:43 AM in response to Luis Sequeira1

thanks:

Last login: Thu Aug 20 17:49:51 on ttys001

/Users/rudolf/.zprofile:1: permission denied: /Users/rudolf/.bash_profile

rudolf@Rudolfs-MacBook-Pro-new ~ % head -10 ~/.zprofile         

~/.bash_profile




##

# Your previous /Users/rudolf/.zprofile file was backed up as /Users/rudolf/.zprofile.macports-saved_2020-08-20_at_17:57:01

##


# MacPorts Installer addition on 2020-08-20_at_17:57:01: adding an appropriate PATH variable for use with MacPorts.

export PATH="/opt/local/bin:/opt/local/sbin:$PATH"

rudolf@Rudolfs-MacBook-Pro-new ~ % 

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

mac notebook catalina Permission denied bash

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.