1) This sounds quite a bit like homework to me. If so, please read the
LQ rule regarding homework.
2) Please use ***
[code][/code] tags*** around your code and data, to preserve the original formatting and to improve readability. Do
not use quote tags, bolding, colors, "start/end" lines, or other creative techniques.
3) Please supply more detail and context. Do you actually NEED to use
for/
if for this? What have you tried to do so far? Also be sure to add any important information about the environment. Are you using
bash or a different shell, for example?
4) Never just say it "didn't work". Always post the exact code you used and the error messages you got.
5) Have you tried searching the forums yet? This is the kind of question that comes up with frustrating regularity.