windows - My bashrc stopped working when I moved it to a new enviornment? -


i moved files windows os x ( on macbook air ). used bash shell on windows , thought using same bash shell ( or similar ) on mac. 1 on windows came installation of git. os x has 1 built in already, called terminal.

.bash_profile has single line source /root/config/bashrc.sh

and bashrc.sh looks this:

warp() {   cd /c/root/ ;  }  launch() {    git add -a . ;   git commit -m $1 ;   git push heroku master ;   echo $1 ; }  #defaults export visual=sublime_text export editor="$visual"  #aliases alias i="ipconfig" alias s="sublime_text &" alias l="ls -a -l"  #commands warp #grunt watch & #sublime_text & clear  #output echo "" echo "************************************************" echo " - .bashrc loaded , sourced bashrc.sh" echo " -  added functions warp() , launch()" echo " -  added alias (i)pconfig (s)ublime (l)s -a -l" echo "************************************************" echo "" 

and here "blowing up" when run it. terminal gave errors below. had no errors.

'bash: /root/config/bashrc.sh: line 1: syntax error near unexpected token `{ 'bash: /root/config/bashrc.sh: line 1: `warp() { 

issue permission related indirect sourcing of .bashrc config /root/config/bashrc.sh

the normal solution directly write config ~/.bashrc file

~/.bashrc

warp() {   cd /c/root/ ;  }  launch() {    git add -a . ;   git commit -m $1 ;   git push heroku master ;   echo $1 ; }  #defaults export visual=sublime_text export editor="$visual"  #aliases alias i="ipconfig" alias s="sublime_text &" alias l="ls -a -l"  #commands warp #grunt watch & #sublime_text & clear  #output echo "" echo "************************************************" echo " - .bashrc loaded , sourced bashrc.sh" echo " -  added functions warp() , launch()" echo " -  added alias (i)pconfig (s)ublime (l)s -a -l" echo "************************************************" echo "" 

alternative solution [ not recommended ]

if use following in ~/.bashrc

source /root/config/bashrc.sh; 

then must give user read , execute permission on following files

/root /root/config /root/config/bashrc.sh 

its not great idea give +rx on /root.

or put config somewhere /etc/user.bashrc.sh have access user /etc..


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -