FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 07-09-2010, 02:15 AM
Alejandro Rodriguez Luna
 
Default Command Preference

Hi all!!, i have a question related to the preference of a command.

What if I have 2 command like ls, one in /bin/ls and another in ~/bin/ls, i'd like to use my own ls, how i can do that?

putting PATH=~/bin:/bin. I mean, my path at the beginning?

----------------------------------

Alejandro Rodriguez Luna

MSN: el_alexluna@yahoo.com.mx

GTalk: alexluna@gmail.com
----------------------------------





*--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-09-2010, 02:41 AM
"Kevin J. Cummings"
 
Default Command Preference

On 07/08/2010 10:15 PM, Alejandro Rodriguez Luna wrote:
>
> Hi all!!, i have a question related to the preference of a command.
>
> What if I have 2 command like ls, one in /bin/ls and another in
> ~/bin/ls, i'd like to use my own ls, how i can do that?
>
> putting PATH=~/bin:/bin. I mean, my path at the beginning?

Setting your PATH environment variable is the preferred way to specify
command execution preferences. The directories listed there get
"searched" in order looking for the command to run. IIRC, shell builtin
commands get run before checking the PATH.

Don't forget to "export" your PATH variable during or after setting it
so that sub-shells can use the new value.

And don't forget to look at what your system is currently using for a
PATH as you don't want to break it with your changes....

--
Kevin J. Cummings
kjchome@rcn.com
cummings@kjchome.homeip.net
cummings@kjc386.framingham.ma.us
Registered Linux User #1232 (http://counter.li.org)
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-09-2010, 04:19 AM
Tim
 
Default Command Preference

On Thu, 2010-07-08 at 19:15 -0700, Alejandro Rodriguez Luna wrote:
> What if I have 2 command like ls, one in /bin/ls and another in
> ~/bin/ls, i'd like to use my own ls, how i can do that?

There is a risk in putting a path before the system paths, if it's
possible for something else to be put into that extra path by hook or
crook.

One option, that's not annoying to manage, if it's only one or two
commands, is to alias them.

--
[tim@localhost ~]$ uname -r
2.6.27.25-78.2.56.fc9.i686

Don't send private replies to my address, the mailbox is ignored. I
read messages from the public lists.



--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 07-09-2010, 12:23 PM
Aaron Konstam
 
Default Command Preference

On Thu, 2010-07-08 at 19:15 -0700, Alejandro Rodriguez Luna wrote:
>
> Hi all!!, i have a question related to the preference of a command.
>
> What if I have 2 command like ls, one in /bin/ls and another in
> ~/bin/ls, i'd like to use my own ls, how i can do that?
>
> putting PATH=~/bin:/bin. I mean, my path at the beginning?
>
> ----------------------------------
> Alejandro Rodriguez Luna
> MSN: el_alexluna@yahoo.com.mx
> GTalk: alexluna@g
yes

--
================================================== =====================
Today is National Existential Ennui Awareness Day.
================================================== =====================
Aaron Konstam telephone: (210) 656-0355 e-mail: akonstam@sbcglobal.net

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 10:24 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org