Results 1 to 5 of 5

Thread: alias for root

  1. #1

    alias for root

    Hi!
    I'm using installwatch from the following PET:
    http://www.linuxjunior.org/cgi-bin/p...play&id=49

    I have a problem with setting the alias for installwatch:
    [tt]alias iw='/usr/local/bin/installwatch -o /var/install/$(basename $(pwd))'[/tt]

    It works fine for the normal user I'm working with, but as I do a "make install" as root, I need this alias for root too. But as soon as I su to root everything is lost:

    Code:
    black666@starbase:~> iw
    /usr/local/bin/installwatch: /var/install/black666: Keine Berechtigung
    Unable to prepare /var/install/black666
    black666@starbase:~> su
    Password:
    starbase:/home/black666 # iw
    bash: iw: command not found
    starbase:/home/black666 #
    I have even put the alias line in the bash_profile of root - still no effect:

    Code:
    starbase:/home/black666 # cat /root/.bash_profile
    alias iw='/usr/local/bin/installwatch -o /var/install/$(basename $(pwd))'
    starbase:/home/black666 #
    Can anyone give me a hint how to make this alias permanent for root?

    Thnx

  2. #2
    Junior Member
    Join Date
    May 2001
    Posts
    53

    Re:alias for root

    Try putting that alias in root's bashrc instead of bash_profile. From what I know, it should work in both, but I had a similar problem, so I basically copied root's .bash_profile into .bashrc, and everything worked fine.

  3. #3

    Re:alias for root

    Instead of maintaining two files, just do this:

    ln -s .bash_profile .bashrc

    That links .bashrc to .bash_profile. I had the same problem using ftrace.

    Thanks to LC for helping me out with that problem ;-)

  4. #4
    Junior Member
    Join Date
    May 2001
    Posts
    53

    Re:alias for root

    [quote author=segfault link=board=1;threadid=3917;start=0#39127 date=1024952803]
    Instead of maintaining two files, just do this:

    ln -s .bash_profile .bashrc

    That links .bashrc to .bash_profile. I had the same problem using ftrace.

    Thanks to LC for helping me out with that problem ;-)
    [/quote]

    Doh! That would be the better idea. Thanks segfault (and LC).

  5. #5

    Re:alias for root

    Thnx, now it works just fine!

Similar Threads

  1. Adding an Alias to Network Bridge
    By elpato77 in forum Linux - Hardware, Networking & Security
    Replies: 10
    Last Post: 07-17-2009, 04:36 PM
  2. Owner for the alias list in sendmail
    By honey bee in forum Linux - Software, Applications & Programming
    Replies: 0
    Last Post: 04-17-2007, 11:32 AM
  3. Qmail Alias with period
    By infinite_root in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 01-16-2004, 07:51 AM
  4. Possible root kit
    By trommaster in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 11-08-2002, 09:22 PM
  5. Root vs su?
    By LearninLinux in forum Linux - General Topics
    Replies: 6
    Last Post: 05-03-2002, 11:36 AM

Bookmarks

Posting Permissions

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