Re: Getting file version



On 2007-02-14, dantes990@xxxxxxxxx wrote:
I want to write a script to get the versions for all the files in a
directory, then output this info (file name and version) to a text
file. Seems like there should be a command or at least simple way to
do this, but I am not finding one. This script will be running from
terminal on OS X and typically I've scripted using the bourne shell
before, but I am open to any ideas. Any help is appreciated.

for file in *
do
printf "%s: " "$file"
: whatever command gets you the version
done > version_file

Many files do not have a version, so use whatever command works
for the files in question.

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.



Relevant Pages