![]() |
[scripting] try to passing arguments to for cycle (inside a function)
Hi
The code: Quote:
Problem: I need a method to maintain the $i variable. In fact, actually, this variable get lost when executed. I think that an escape can preserve this variable and permit its execution inside the function, but I've no idea about. Any ideas? |
Are you trying to run the [ReadFileLines "list.txt" "echo $i" ] only once, or do you want it ran every time the for loop sequences? From what I can see though, you can declare another variable and set it to the value of i, just make sure to declare it outside of the for-loop scope.
Kind regards, Josh |
Hi,
try this Code:
#!/bin/bashecho $i inside the for-loop instead of expanding a variable that holds an instruction? |
Quote:
thanks 10000!!! :cool: solved! |
| All times are GMT -5. The time now is 08:55 PM. |