top_left top_right
bottom_left
Next Event: Unknown | Forum Rules | QGL Website | Event Registration
openFolder AusForums.com
iconwatfolderLineopenFolder LANs
iconwatfolderLineopenFolder QGL
iconwatfolderLineopenFolder QGL Forum
Author
Topic: Shell Scripting Quickie
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?
system
--
TufNuT
I like eel pie
Posts: 2508
Location: Brisbane, Queensland
some tutor you are dont even know how to teach your own subject.
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.
Skitza
Posts: 7118
Location: Brisbane, Queensland
Have you tried google ?
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.
system
--
Not a new post since your last visit.
New Post Since your last visit
Back To Forum
Advertise with Us | Privacy Policy | Contact Us
© Copyright 2001-2026 AusGamers Pty Ltd. ACN 093 772 242.
Hosted by Mammoth Networks - Australian VPS Hosting
Web development by Mammoth Media.