Re: [BASH] shell functions don't work the same when opening sub-shells
From: Chris F.A. Johnson (cfajohnson_at_gmail.com)
Date: 11/28/05
- Next message: Andrew Falanga: "Re: [BASH] shell functions don't work the same when opening sub-shells"
- Previous message: Chris F.A. Johnson: "Re: Env variable whit asterisk"
- In reply to: Andrew Falanga: "[BASH] shell functions don't work the same when opening sub-shells"
- Next in thread: Andrew Falanga: "Re: [BASH] shell functions don't work the same when opening sub-shells"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Nov 2005 10:57:39 -0500
On 2005-11-28, Andrew Falanga wrote:
> Hi,
>
> I've got a rather odd occurrance when I open a sub-shell for changes to
> my environment.
A subshell can only change its own environment, not that of the
calling shell.
> In my .bashrc file I have some shell functions that
> I've written to help make life easier for me.
>
> One of these functions takes an option, -p, and then a pattern to search
> for. The pattern if found, is used in creating the sub-shell. I have
> it setup that the function always defaults to a specific type of pattern
> if the -p option is not provided.
>
> When starting a new shell all works as it should, but after exiting a
> sub-shell and using this function again, the function completely ignores
> the -p option and simply uses the default. Can anyone shed some light
> as to why for me?
If it changes the function, it is not a subshell. Please post some
code that exhibits the problem.
-- Chris F.A. Johnson, author | <http://cfaj.freeshell.org> Shell Scripting Recipes: | My code in this post, if any, A Problem-Solution Approach | is released under the 2005, Apress | GNU General Public Licence
- Next message: Andrew Falanga: "Re: [BASH] shell functions don't work the same when opening sub-shells"
- Previous message: Chris F.A. Johnson: "Re: Env variable whit asterisk"
- In reply to: Andrew Falanga: "[BASH] shell functions don't work the same when opening sub-shells"
- Next in thread: Andrew Falanga: "Re: [BASH] shell functions don't work the same when opening sub-shells"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|