Find the answer to your Linux question:
Results 1 to 4 of 4
I was doing research and found out that alias can not be run from scripts. I want to know how would I go about allowing myself to run alias from ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! sonicx059's Avatar
    Join Date
    Dec 2009
    Location
    in a land filled with dreams and hopes.
    Posts
    15

    setting up alias


    I was doing research and found out that alias can not be run from scripts. I want to know how would I go about allowing myself to run alias from scripts. For slax I was told to just append my .bash_rc or profile but I can not find it on it slax.

    So any ideas for turning this on? Or alternatives to automating my alias commands?

  2. #2
    Just Joined!
    Join Date
    Jan 2010
    Posts
    7
    You can create one(.bashrc ) in your home directory.
    code: touch ./bashrc
    Then use a text editor to add your aliases.

    What do you mean `run alias' from scripts anyway?

  3. #3
    Just Joined! sonicx059's Avatar
    Join Date
    Dec 2009
    Location
    in a land filled with dreams and hopes.
    Posts
    15
    Well I wanted to just do this from a script.

    alias rm="rm -iv"
    alias mv="mv -iv"
    alias ..="cd .."
    alias .="pwd"
    alias ls="ls -lF --group-directories-first --color=always"
    alias la="ls -lAF --group-directories-first --color=always"
    alias cls="clear"
    alias cp="cp -iv"
    alias rmdir="rmdir -iv"

  4. #4
    Just Joined!
    Join Date
    Jan 2010
    Posts
    7
    hi sonicx059. Well there are a few ways to do this. The most common would be to create a .bashrc in your home directory, edit it and paste your aliases. These will be read by bash every time u open a terminal. And yeah this is how i did it, unlike other versions of linux like ubuntu, slakware doesn't come with the default scripts in your home directory so whenever you need them you simply create and edit them.
    Hope this helps.

Posting Permissions

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