Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!midway!clout!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.shell Subject: Re: 1 at a time? Message-ID: <1991May19.202348.25774@chinet.chi.il.us> Date: 19 May 91 20:23:48 GMT References: <7957@uklirb.informatik.uni-kl.de> Organization: Chinet - Chicago Public Access UNIX Lines: 21 In article <7957@uklirb.informatik.uni-kl.de> robby@nuchat.sccsi.com (Robert Oliver Jr.) writes: > Is there a simple way of putting a listing of files at the command line one >at a time? Not the hole file listing just the first one. When the program go to >the second and so forth it dose not tag on all the other files. Which files? What command line? If you want to run a program for each file in the current directory: for i in * do command $i done The * is a wild-card directory meta-character that is expanded by the shell into the list of matching filenames. The the "for" loop traverses the list, setting the variable "i" to the next item on each pass through the loop. Les mikesell les@chinet.chi.il.us