LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 12:06 PM   #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, 12:08 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,811
Blog Entries: 1

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:11 AM
how to change working directory of the current shell? kevin_chn Programming 6 05-16-2008 03:26 AM
Grabbing the current directory in shell script binarybob0001 Programming 4 11-02-2007 07:03 PM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 07:54 PM
Shell script to copy file name with part of directory Transition Linux - General 5 01-18-2005 06:40 PM


All times are GMT -5. The time now is 01: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration