Re: Bash scripting problems

From: Jeff Kinz (jkinz_at_kinz.org)
Date: 01/08/05

  • Next message: Alexander Dalloz: "Re: Bash scripting problems"
    Date: Sat, 8 Jan 2005 13:04:57 -0500
    To: For users of Fedora Core releases <fedora-list@redhat.com>
    
    

    On Sat, Jan 08, 2005 at 06:29:41PM +0200, Chadley Wilson wrote:
    > I have this issue:
    > in /root/.bashrc there is an alias which breaks my script in the following
    > way:
    > When I need to copy or del a file the rm -i and cp -i are preventing things
    > from running smoothly.

    You should always use the absolute paths to invoke commands in any script
    run by root. This prevents people from putting "trojans" in the path
    and it will also solve the problem you are experiencing.

    for example
    use "/bin/cp" for cp
    use "/bin/rm" for rm.

    As a practical matter almost no one uses the "only invoke commands by
    absolute path" approach. Its too cumbersome.

    But the absolute path approach will fix the problem of invoking aliases
    rather than the actual commands. And it doesn't break when no aliases
    are defined.

    -- 
    DEAD COMPANY WALKIN'      #####    #####   #######  
    DEAD COMPANY WALKIN'     #     #  #     #  #     #  
    DEAD COMPANY WALKIN'     #        #        #     #  
    DEAD COMPANY WALKIN'      #####   #        #     #  
    DEAD COMPANY WALKIN'           #  #        #     #  
    DEAD COMPANY WALKIN'     #     #  #     #  #     #  
    DEAD COMPANY WALKIN'      #####    #####   #######  
    Linux/Open Source:  Your infrastructure belongs to you, free, forever.
    Idealism:  "Realism applied over a longer time period"
    http://www.scaled.com/projects/tierone/
    http://kinz.org
    Jeff Kinz, Emergent Research, Hudson, MA.
    ~
    ~
    ~
    ~
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Alexander Dalloz: "Re: Bash scripting problems"