Find the answer to your Linux question:
Results 1 to 10 of 10
Hi all, I need to make a alias and I am a little confussed how to do it. As some websites say it has to be in profile and other ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    38

    Creating an alias on universtiy server

    Hi all,

    I need to make a alias and I am a little confussed how to do it. As some websites say it has to be in profile and other says it goes in bashrc.

    on the server I have these files
    bash_history
    bash_profile
    bashrc
    cshrc
    dtprofile
    login
    mysql_history
    newsrc

    I been trying to do this and think may have problem now as when I log in I get error it says bash_profile syntax error unexpected token 'fi'

    many thanks

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    it can go in any file as long as that file gets sourced when you log in

    .bashrc and .bash_profile are the most common to us

    can you post exact error message or at least contents of the file?

  3. #3
    Just Joined!
    Join Date
    May 2008
    Posts
    38
    # Login shell
    if [ -r $HOME/.bashrc ]; then
    source $HOME/.bashrc

    fi


    that the bash_profile

    and this is bash rc is

    #Non-login interactive shells

    # Set DISPLAY if coming from an X display and not already set.
    if [ -z $DISPLAY ]; then
    if [ $TERM ]; then
    if [ `echo $TERM | grep xterm` ]; then export DISPLAY=`/usr/local/bin/xdisplay` ; fi
    fi
    fi


    export PATH=~/bin:`/usr/local/bin/localpath -sh`:/usr/bin:/usr/ucb:.
    alias cake="php /proj/name/project/leader/cgi-bin/cake_1.2.5/cake/console/cake.php"

    umask 022


    however when i try it i get unknow bash command

    thanks

  4. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    nothing obviously wrong jumps out at me, hopefully someone else has better eyes

  5. #5
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    Do you have the php cli package installed?
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  6. #6
    Just Joined!
    Join Date
    May 2008
    Posts
    38
    I am not sure as this is university server we are using php so I would guess so

  7. #7
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    OK, it may be a path issue...

    Try running "which php" and using the full path in your script. If you get no response from which php then the cli is not installed
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  8. #8
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    which command will only tell you if it is in your path or not, not if it is installed

    you could try locate php instead

  9. #9
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    locate will show everything with php in the name so you may get a lot of output.

    I've just learned something about which. Thanks
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  10. #10
    Just Joined!
    Join Date
    May 2008
    Posts
    38
    what I dont get if I try have it as alias it dont work if i type the command alias line into command line then type cake it works so it werid

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...