|
![]() |
|
| Author |
|
|||||||
|
Hogfather
Posts: 906
Location: Cairns, Queensland
|
Hi I'm supervising a practical in a Uni course. Have had a big week @ work and didn't get a chance to prep it as well as I'd like. Hence the problem.
Its on shell programming, and one of the students is trying to use a while loop to increment a counter. However the shell seems to have some funky scope rules - when the while loop exits the value is reset to what it was prior to the loop opening. Is this expected, and how do you get around it? |
|||||||
| #0 07:57pm 15/03/06 |
|
|||||||
|
system
|
--
|
|||||||
| #0 |
|
|||||||
|
TufNuT
I like eel pie
Posts: 2508
Location: Brisbane, Queensland
|
some tutor you are dont even know how to teach your own subject.
|
|||||||
| #1 08:02pm 15/03/06 |
|
|||||||
|
Hogfather
Posts: 907
Location: Cairns, Queensland
|
f*** you :) Being a tutor doesn't make you the subject's grand oracle!
In case anyone cared, its caused by spawning a subshell in old sh when you do file io that encompasses a while loop. |
|||||||
| #2 08:13pm 15/03/06 |
|
|||||||
|
Skitza
Posts: 7118
Location: Brisbane, Queensland
|
Have you tried google ?
|
|||||||
| #3 09:05pm 15/03/06 |
|
|||||||
|
dafugg
Posts: 1276
Location: Brisbane, Queensland
|
how about at least telling us:
(1) the shell env? tcsh? csh? bash? .. (2) the libreadline version? (3) any other libraries or func repos used? (4) a copy of the f***ing script? f***ing hell.. i'm having a mind power zeta thought! how about defining your question like a good STUDENT would before asking us? as bad as my tutors all those years ago. |
|||||||
| #4 05:45am 16/03/06 |
|
|||||||
|
system
|
--
|
|||||||
| #4 |
|
|||||||
|
| ||||||||