LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-16-2009, 08:42 AM   #1
vadiml
Member
 
Registered: Oct 2003
Posts: 44

Rep: Reputation: 19
LDD mistery


Hello,

While looking at the /usr/bin/ldd script i observe there a following chunk of code:

for file do
... do something with ${file}
done


Can some shell guru explain me please how does the above loop works?

It seems that 'file' is not shell builtin...
If simply execute file on the command line t gives a help message


Thanks
Vadim
 
Old 07-16-2009, 10:45 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
file is a local variable in that script. But, I don't see how it is set. Hopefully someone more versed in shell scripting can tell us.
 
Old 07-17-2009, 04:46 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Code:
for file in var1 var2 var3; do
done
file iterate in the list var1, var2, var3

Code:
for file do
done
file iterate over positional parameters list, i., $1, $2, $3, etc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ldd command veeruk101 Linux - General 10 07-25-2007 07:22 AM
Ubuntu 5.10 -> 6.06: diversion of /usr/bin/ldd to /usr/bin/ldd.amd64 by ia32-libs HellSpawn Linux - Software 2 06-04-2006 09:18 PM
about ldd -d jingle_mj Programming 4 09-10-2004 06:25 AM
about ldd -d jingle_mj Linux - General 2 08-25-2004 06:30 AM
ldd simon Linux - General 1 08-02-2001 06:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration