bug-bash
[Top][All Lists]
Advanced

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

Re: conditional aliases are broken


From: Greg Wooledge
Subject: Re: conditional aliases are broken
Date: Thu, 18 Aug 2011 08:04:54 -0400
User-agent: Mutt/1.4.2.3i

On Wed, Aug 17, 2011 at 08:46:34PM -0700, Linda Walsh wrote:
> how do you declare a variable for storage in the context of the caller?
> (using a function)...
> ???

The *caller* declares it.

> I found it very troublesome
> inside a function, to store a value into a local variable in the caller.

caller() {
  local x=0
  callee
  echo "x is <$x>"
}

callee() {
  x=42
}

caller



reply via email to

[Prev in Thread] Current Thread [Next in Thread]