Guest User

Untitled

a guest
Aug 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. Bash Script - Variable Scope in Do-While loop
  2. while read line
  3. do
  4. let variable=$variable+$someOtherVariable
  5. done
  6. return $variable
  7.  
  8. variable=$(variable=0; while read line; do variable=$((variable+someOtherVariable)); done; echo $variable)
Add Comment
Please, Sign In to add comment