Page 1 of 1

for loops arguments

Posted: Thu Jun 28, 2012 1:11 pm
by kaykav
Hi
I've been trying to understand using bash scripts for the past year. Doing 'for loops' now. What does this syntax mean? 'for arg in list'
What is arg? Most importantly , where did 'you' learn all these arguments or parameters. I go thru a tutorial and all of a sudden they use a term unknown to me.
So I have to go to a Forum to ask. There must be a documentation on all the terms being used in writing bash scripts. No? Any way for now, what is 'arg'?
Thank you...

Re: for loops arguments

Posted: Thu Jun 28, 2012 2:13 pm
by DrHu
http://www.linuxtopia.org/online_books/ ... oops1.html
http://hiox.org/33112-shell-script.php
  • During each pass through the loop, arg takes on the value of each successive variable in the list.
    --what that command line is doing

bash scripting..
http://linuxconfig.org/Bash_scripting_Tutorial

http://linuxreviews.org/beginner/Bash-S ... index.html
--working carefully through any tutorials/guides such as the link above will help, or even a bash howto in 24hrs type book or visual guide book as another choice..

Re: for loops arguments

Posted: Thu Jun 28, 2012 5:08 pm
by RETNUH
This is a pretty good Bash tutorial.

You might want to get a programmer's dictionary.

Re: for loops arguments

Posted: Thu Jun 28, 2012 7:25 pm
by kaykav
HEY
Thank you for your rapid response. I thought the 'arg' being used had a special meaning, other than being used as a variable. I've seen it in other notations. Again..Thanks

Re: for loops arguments

Posted: Fri Jun 29, 2012 8:11 am
by Habitual
RETNUH wrote:This is a pretty good Bash tutorial....
Mad Props. Great Resource