Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Oct 14th, 2004, 3:32 PM   #1
elmo
Newbie
 
Join Date: Oct 2004
Posts: 4
Rep Power: 0 elmo is on a distinguished road
alright, i got some code like this:

function foo() {
  echo "var: $var"
}

function bar() {
  for i in `seq 10 10 100`; do
     var=$(($var + $i))
     echo $i
  done
}

bar
foo

this will set var to some value, and echo $i

if i try to add some nifty stuff to the second function

...
function bar() {
  for i in `seq 10 10 100`; do
     var=$(($var + $i))
     echo $i
  done | dialog --gauge "ra ra ra" 10 20 0
}
...

the gauge will work, but var wont be set to anything due to variable protection (or some such).

Is there any way around this, so that var will be accesible in foo()?
elmo is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:52 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC