Find the answer to your Linux question:
Results 1 to 2 of 2
I have an alias both in my .bashrc and my .bash_profile - alias autodock4='/home/fugate/disk2/AutoDock/autodock4/bin/autodock4' The alias works fine if called on the command line, but when I run a bash ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    10

    bashrc, bash_profile alias issues

    I have an alias both in my .bashrc and my .bash_profile -

    alias autodock4='/home/fugate/disk2/AutoDock/autodock4/bin/autodock4'

    The alias works fine if called on the command line, but when I run a bash script that calls the alias, the script dies and says autodock4 command not found.

    I tried exporting the path -
    DOCKPATH=$DOCKPATH:/home/fugate/disk2/AutoDock/autodock4/bin/autodock4
    export DOCKPATH

    Didn't help.

    How can I get my script to read the alias from my .bashrc?

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    Since a script is executed by a non interactive bash
    shell, it does not read either .bash_profile or .bashrc.
    Set the variables, paths or aliases you want within the script.

Posting Permissions

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