Trouble with Aliases

Discussion in 'macOS' started by ganondor, Dec 21, 2009.

  1. ganondor macrumors newbie

    Joined:
    Dec 21, 2009
    #1
    When I try to use certain aliases I have set up it returns:
    Code:
    -bash: example: command not found
    These are the aliases:
    Code:
    alias ls='ls -al'
    alias cls='clear'
    alias x='exit'
    alias commands='cat /Users/user/.commands'
    alias q='quit'
    alias bgss='/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaver$
    alias chmodman='cat /Users/user/.chmodman'
    alias show='defaults write com.apple.finder AppleShowAllFiles TRUE ; killall Finder'
    alias hide='defaults write com.apple.finder AppleShowAllFiles False ; killall Finder'
    alias ..='cd ..'
    
    Some of these work: ls, cls, q, & x, but the rest do not. Please help, for it is probably something stupidly simple that I am missing.
     
  2. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
  3. ganondor thread starter macrumors newbie

    Joined:
    Dec 21, 2009
    #3
    I have them in .bashrc, which I load in .bash_profile.
    Code:
    source ~/.bashrc  # get aliases
    
     
  4. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #4
    What do you get back when you type "alias" in Terminal?

    S-
     
  5. ganondor thread starter macrumors newbie

    Joined:
    Dec 21, 2009
    #5
    The list of the ones which I said worked for me in the first post. Thank you for helping me with this, by the way.
     
  6. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #6
    If you source .bashrc yourself, what do you get? Any errors?

    I have my aliases in ".bash_profile". Have you tried them in that file instead?

    S-
     
  7. ganondor thread starter macrumors newbie

    Joined:
    Dec 21, 2009
    #7
    The same thing. Also, when it is sourced, by me or by .bash_profile, I receive two errors. This has been happening the whole time, forgot to mention.
    Code:
    -bash: .bashrc: line x: unexpected EOF while looking for matching `''
    -bash: .bashrc: line z: syntax error: unexpected end of file
    
    x is the cd .. alias, and z is a blank line at the end.
     
  8. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #8
    You are missing a single quote somewhere.

    Look at this line:

    Code:
    alias bgss='/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaver$
    Do you see what is missing? There should be a single quote after the "$" in "ScreenSaver$".

    S-
     
  9. ganondor thread starter macrumors newbie

    Joined:
    Dec 21, 2009
    #9
    Thank you. I knew it would be a simple mistake.
     

Share This Page