Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Setting up aliases outside .bashrc

Arne Schmitz <arne.schmitz@mmweg.rwth-aachen.de> writes:

>Roy Schestowitz schrieb:

>> Is there some scope
>> limitation? Do they expire when scripts apart from .bashrc end?

>You have to source the script, not execute it from .bashrc. Sourcing is done
>like this:

>        . yourscript.sh

>Without the leading tab, of course.

An alias is only good at the level at which it is invoked or for children
of that level. It does NOT propagate to parents of that level. thus if you
run the script it is that script and its children for which the alias
applies. It does NOT apply to the parent level which called the script. 
When you source it ( also done with 
source yourscript.sh
)the commands in that file are run by the parent level, and thus apply at
that level.


[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index