Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, I have a script that I run using ./dom example.com. I want to add an alias to .bashrc so that I can run it using "d example.com". I have ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    3

    Adding Alias to .bashrc


    Hello,

    I have a script that I run using ./dom example.com.

    I want to add an alias to .bashrc so that I can run it using "d example.com".

    I have tried adding each of the lines below in turn but I still receive the error:
    -bash: d: command not found

    alias d="/bin/bash /home/user/dom"
    alias d="./home/user/dom"
    alias d="sh /home/user/dom"

    Any help is greatly appriciated.

    Regards,
    Colin

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    add

    alias d='/home/user/dom '

    to the ~/.bashrc
    and relogin. You script is only sourced when you open a new shell session (or relogin.)
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Posts
    3
    Thank you for your help.
    Worked a treat.

    Colin

  4. #4
    Linux User glennzo's Avatar
    Join Date
    Sep 2004
    Location
    Salem, Mass
    Posts
    464
    You can edit .bashrc and then type source ~/.bashrc. The changes will then be in effect
    Glenn
    Powered by Fedora

Posting Permissions

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