* Jonathan Wilson
Howdy,
In order to run a command form bash fr every file in a directory, let's use tar xzvf for instance, I'd use something like this:
for tarball in ./*.tar.gz; do tar xzvf $tarball ; done
And it would open every tar.gz archive in the current directory.
Now my question is, is it possible to do something like that "for" every line in a file?
In my case, I now have a list of hostnames and I want to run nslookup on each of them with a shell script (so I won't have to do it by hand).
for host in hostnames.lst ; do nslookup $host; done
for host in `cat hostnames.lst` ; do nslookup $host; done -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogic, with just a little bit more effort." -- A. P. J.