LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2010, 11:06 AM   #1
gujedan
Member
 
Registered: Oct 2010
Posts: 121

Rep: Reputation: 1
for each file in current directory.. [shell script]


managed to forget how to do that. there was a keyword like filein or fileindir or something..
how can i do that?
 
Old 11-27-2010, 11:08 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Code:
for i in *
do
....
done
You can find more examples here:
http://www.cyberciti.biz/faq/bash-for-loop/
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to call a script in a new shell from the current shell Bone11409 Linux - Newbie 2 05-04-2010 04:11 AM
how to change working directory of the current shell? kevin_chn Programming 6 05-16-2008 02:26 AM
Grabbing the current directory in shell script binarybob0001 Programming 4 11-02-2007 06:03 PM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 06:54 PM
Shell script to copy file name with part of directory Transition Linux - General 5 01-18-2005 05:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:17 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