[PLUG] BASH Busted??
Kenneth G. Stephens
kens at cad2cam.com
Tue Jun 14 03:23:16 UTC 2005
On Mon, 2005-06-13 at 19:06 -0700, William A Morita wrote:
> #!/bin/bash
> # Script to test "global" variable
> #
>
> set -x
>
> JUNK="Initial Value"
>
> function SomeFunction
> {
> set -x
> JUNK="Set in function"
> echo $JUNK
> }
>
> Value="`SomeFunction`"
> #Num=$((SomeFunction))
> #let Num=SomeFunction
>
> echo "Value=" $Value
> echo "JUNK =" "$JUNK"
What is $JUNK before you set it inside the function? Bet it is equal to
"Initial Value".
--
Ken Stephens
CAD 2 CAM
More information about the PLUG
mailing list