Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

BLU Discuss list archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] What the use of .bashrc

If bash can do it, it's in this guide, my bash bible:

Sent from my iPad

On Oct 30, 2012, at 12:08 PM, Jerry Feldman <gaf at> wrote:

> I generally use "Learning the BASH Shell" as a reference, but here is
> the definition:
> On 10/30/2012 11:46 AM, John Abreau wrote:
>> I just looked for that in the bash manpage, and i can't find anything
>> describing
>> that behavior. Can you highlight where you discovered that?
>> On Tue, Oct 30, 2012 at 11:07 AM, Jerry Feldman <gaf at> wrote:
>>> On 10/30/2012 10:58 AM, joe at wrote:
>>>>  Looks to me like the first test only tests if $1 is not at the end of $PATHor am I missing something?    ----- Original Message -----From: &quot;Jerry Feldman&quot; >;gaf at
>>> No, it tests is $1 exists in $PATH.
>>> I really hate bash pattern matching because I have to read the manual
>>> every time I use them.
>>> in this case '*:"$1":*' looks for $1 anywhere in $PATH.
> Look at expressions. A path is delimited by colons. So, this means look
> for $1 anywhere in a path. You can easily test it. I have not looked at
> some of the boundary cases, but they appear to work since I've been
> using this for years.
>    case ":${PATH}:" in
>        *:"$1":*)
>            ;;
> Note that $PATH is prepended and appended by ':'. So, assume a PATH is
> $HOME/bin/usr/bin, the pattern is ":$HOME/bin:/usr/bin:"
> So, it will look for $1 anywhere between 2 colons.
> -- 
> Jerry Feldman <gaf at>
> Boston Linux and Unix
> PGP key id:3BC1EB90 
> PGP Key fingerprint: 49E2 C52A FC5A A31F 8D66  C0AF 7CEA 30FC 3BC1 EB90
> _______________________________________________
> Discuss mailing list
> Discuss at

BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!

Boston Linux & Unix /