Find the answer to your Linux question:
Results 1 to 6 of 6
hi, I wanna know how to export aliases in bash? thanks, karthik...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    12

    how to export aliases?


    hi,
    I wanna know how to export aliases in bash?

    thanks,
    karthik

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    i am not getting it. can you explain a bit more?
    you can set aliases globally in /etc/profile. for single user, set these in .bashrc file.





    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Oct 2006
    Posts
    12
    I'm using a script where i define my aliases.I do a .<space>script to make these aliases take effect.but this doesnot export my alias commands as env variables.I want my aliases to be exported as env variables so that i can use them in a script like i do on command line.I'm using bash

  4. $spacer_open
    $spacer_close
  5. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    dont use keyword 'export' before 'alias'. it will work for current shell only. execute alias script again on starting new shell session.





    casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  6. #5
    Just Joined!
    Join Date
    Mar 2013
    Posts
    1
    Quote Originally Posted by karthik_s View Post
    hi,
    I wanna know how to export aliases in bash?

    thanks,
    karthik
    My bash profile file is: .bash_profile, includes my bash aliases file: .bash_alias, via: `source .bash_alias`

    To append alias commands to your alias file so that they are saved do for example:

    `alias .. ='cd ..' >> .bash_alias`

    or if your alias file is empty and you have created some temporary aliases you want to save:

    `alias > .bash_alias`

  7. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,444
    Closed this very old thread.
    You must always face the curtain with a bow.

Posting Permissions

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