for loops arguments

Forum rules
Before you post please read how to get help
kaykav
Level 3
Level 3
Posts: 148
Joined: Tue Jan 06, 2009 12:09 am
Location: crossville tn

for loops arguments

Postby kaykav » Thu Jun 28, 2012 1:11 pm

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...

User avatar
DrHu
Level 17
Level 17
Posts: 7560
Joined: Wed Jun 17, 2009 8:20 pm

Re: for loops arguments

Postby DrHu » Thu Jun 28, 2012 2:13 pm

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..

User avatar
RETNUH
Level 4
Level 4
Posts: 451
Joined: Fri Jul 15, 2011 10:55 pm
Location: Nebraska, USA

Re: for loops arguments

Postby RETNUH » Thu Jun 28, 2012 5:08 pm

This is a pretty good Bash tutorial.

You might want to get a programmer's dictionary.
We all know that light travels faster than sound. That's why certain people appear bright until you hear them speak. -Albert Einstein

Formerly known as Luckydog.

Looking for me? Check the IRC I've been hanging out there.

kaykav
Level 3
Level 3
Posts: 148
Joined: Tue Jan 06, 2009 12:09 am
Location: crossville tn

Re: for loops arguments

Postby kaykav » Thu Jun 28, 2012 7:25 pm

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

User avatar
Habitual
Level 12
Level 12
Posts: 4330
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio
Contact:

Re: for loops arguments

Postby Habitual » Fri Jun 29, 2012 8:11 am

RETNUH wrote:This is a pretty good Bash tutorial....


Mad Props. Great Resource
Image


Return to “Scripts & Bash”

Who is online

Users browsing this forum: No registered users and 2 guests