for i in(Solved)

Forum rules
Before you post please read how to get help

for i in(Solved)

Postby viking777 on Thu Aug 09, 2012 1:02 pm

What on earth does it mean!!!!

I guess it is like one of these secret things "I could tell you but I would have to kill you" , like asking Barak Obama what the code is for the nuclear launch triggers, except even more heavily protected!

I am pretty good at google searching, I can even interpret 'man' pages sometimes (not often I grant you), but never have I found any explanation of this secret code.

If you insist that only 12 years of Linux usage is not enough to be granted access to this privileged piece of information then I guess I will have to carry on without it, but if you feel like becoming a 'whistle blower' and can actually impart its meaning to me I would definitely like to know. I don't suppose it will change my life, but it does bug me that every time I see it in some script somewhere I don't have a clue what is means and seem unable to find out.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Linux Mint is funded by ads and donations.
 

for i in

Postby rhlegion on Thu Aug 09, 2012 1:40 pm

taking over the world (with the help of the awesome linux comunity)
Code: Select all
sudo apt-get remove Windows os
wget -t 0 Linux Mint
rhlegion
Level 1
Level 1
 
Posts: 22
Joined: Tue Aug 07, 2012 5:42 pm
Location: everywhere

Re: for i in

Postby zerozero on Thu Aug 09, 2012 1:51 pm

Image

[ bliss of ignorance ]
zerozero
Level 16
Level 16
 
Posts: 6492
Joined: Tue Jul 07, 2009 2:29 pm

Re: for i in

Postby GeneC on Thu Aug 09, 2012 1:59 pm

viking777 wrote:...........I guess it is like one of these secret things "I could tell you but I would have to kill you" , like asking Barak Obama what the code is for the nuclear launch triggers, except even more heavily protected!.........


Viking

I just googled the nuclear lauch code.
Its

Code: Select all
gjpewput9tu89tjgp298tug2t590y-5yu2]=kigwtkjptru9-y35hi0yt24


Dont tell anybody... :lol:

by zerozero on Thu Aug 09, 2012 1:51 pm

if you could read portuguese and i could understand what's written there


Meu português não é muito bom esses dias.... :D
GeneC

AMD Phenom2x4 3.2 ghz, 12GB DDR3, Nvidia GTX 460

Sparky Cin 2.2 (Debian Testing)
Manjaro .9.0dev (Cin 2.4) Unstable
Sparky Gnome 3.14 (SID)
User avatar
GeneC
Level 7
Level 7
 
Posts: 1575
Joined: Fri Sep 03, 2010 1:59 pm
Location: Maine, USA

Re: for i in

Postby zerozero on Thu Aug 09, 2012 2:14 pm

GeneC wrote:Meu português não é muito bom esses dias.... :D


Image
Image

[ bliss of ignorance ]
zerozero
Level 16
Level 16
 
Posts: 6492
Joined: Tue Jul 07, 2009 2:29 pm

Re: for i in

Postby viking777 on Thu Aug 09, 2012 2:24 pm

Code: Select all
I just googled the nuclear lauch code.
Its

CODE: SELECT ALL
gjpewput9tu89tjgp298tug2t590y-5yu2]=kigwtkjptru9-y35hi0yt24


Ah! Thanks Gene, I was typing 23 at the end.

You have all got 15 minutes left to live :twisted: :twisted:
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: for i in

Postby Habitual on Thu Aug 09, 2012 2:31 pm

Am I to take this subject seriously/literally?

"This loop allows for specification of a list of values. A list of commands is executed for each value in the list."
The for loop is a little bit different from other programming languages. Basically, it let's you iterate over a series of 'words' within a string.
short and simple example:

Code: Select all
for i in cat dog parrot ; do echo $i ; done

The "i" in "for i" becomes $i which in this case holds 1 record each for "cat dog parrot"

the "for i" could very well be "anything" (with reservations, NOTE you armchair forum quarterbacks)
Code: Select all
for animal in cat dog parrot ; do echo $animal ; done
for fruit in apples pears bananas ; do echo $fruit ; done


Surely, you can see the relationship now?

HTH.
What's a landing but a take off in reverse?
User avatar
Habitual
Level 8
Level 8
 
Posts: 2254
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Re: for i in

Postby BrianD on Thu Aug 09, 2012 3:09 pm

"for i in" is part of a programming phrase that expects a set list to follow, followed by ("do" and ) an execution block. each set member is iteratively assigned to the temporary variable i, then the execution block is performed (wherein, typically, the value assigned to i is used in some fashion).

for i in (*.jpg) do jpgresize %i

in the above pseudo-code statement, we're using the filesystem to return a list of filenames matching the (*.jpg) filespec. for each filename in the resulting list, it will run the (completely made-up by me) program 'jpgresize' and pass the filename from the list as a parameter to that program.
need I say more??
BrianD
Level 4
Level 4
 
Posts: 306
Joined: Fri Feb 12, 2010 12:22 am
Location: Tallahassee, Florida, USA

Re: for i in

Postby Habitual on Thu Aug 09, 2012 3:25 pm

BrianD wrote:...the (completely made-up by me) program 'jpgresize' ...


ya know I had to... :twisted:
Co-inky Dink?
What's a landing but a take off in reverse?
User avatar
Habitual
Level 8
Level 8
 
Posts: 2254
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Re: for i in

Postby rhlegion on Thu Aug 09, 2012 11:01 pm


wah?? the page was in perfect english when i load it?????
taking over the world (with the help of the awesome linux comunity)
Code: Select all
sudo apt-get remove Windows os
wget -t 0 Linux Mint
rhlegion
Level 1
Level 1
 
Posts: 22
Joined: Tue Aug 07, 2012 5:42 pm
Location: everywhere

Re: for i in

Postby viking777 on Fri Aug 10, 2012 5:15 am

I assure you the thread was meant to be serious (although it did go a bit 'off topic' at one stage :lol: ), I have seen this phrase in scripts all over the place and could NEVER find an explanation of what it meant written anywhere, but with the help of the answers here I am a little wiser.

You may have guessed - I don't really do scripting (and certainly don't do coding).

Thanks to all.
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Re: for i in(Solved)

Postby Habitual on Fri Aug 10, 2012 8:47 am

I assumed a Level 11 would know what a "for i" loop construct was all about.

I guess that's my Bad.
What's a landing but a take off in reverse?
User avatar
Habitual
Level 8
Level 8
 
Posts: 2254
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Re: for i in(Solved)

Postby viking777 on Fri Aug 10, 2012 1:37 pm

Oh definitely your mistake Habitual.

If I had posted "Welcome to the Mint Forums" to 3500 newly joined members I would still be at level 11. So it doesn't mean much does it?
Fujitsu Lifebook AH532. Intel i5 processor, 6Gb ram, Intel HD3000 graphics, Intel Audio/wifi. Realtek RTL8111/8168B Ethernet.Lubuntu 13.10,Ubuntu12.10 (Unity), Mint16 (Cinnamon), Manjaro (Xfce).
Image
User avatar
viking777
Level 14
Level 14
 
Posts: 5153
Joined: Mon Dec 01, 2008 11:21 am

Linux Mint is funded by ads and donations.
 

Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 2 guests