[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] run at global level form a function?
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] run at global level form a function? |
Date: |
Wed, 25 Feb 2015 08:43:04 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Feb 24, 2015 at 10:37:10PM +0000, Patrick Schleizer wrote:
> Is it possible to do stuff within a bash function as if it was executed
> outside a function?
Too vague.
You can access variables (read *and* write) from any previous scope,
but you don't get to choose which scope. It's always the most recent
one, unless you use "declare -g" to jump straight to the global scope,
as previously noted.
You have access to all of the file descriptors. There is no scope on
those.