|
|
#1 |
|
All Star
Join Date: Jan 2002
Posts: 579
|
Finding files by creator code
Hello,
I'm trying to find all files with a certain creator code. I tried googling for a while and since I didn't come up with anything interesting, decided to try and script it. The problem I'm running into is one of quoting, the find I'm using to generate a list of files gets broken up at the space between files, for example it fails with "Address Book" or the like. I tried looking at find's man page and the only option similar was -X but it's not quite what I need. Any help is appreciated, here's the script: Code:
#!/bin/sh
# Find by creator from current dir
list=`find . -type f`
for file in $list
do
code=`GetFileInfo -c "${file}"`
if [ "$code" == "\"CODE\"" ]
then
echo $file
fi
done
exit 0
thanks, v Edit: Here's usage and errors: Code:
% touch file % touch "some file" % SetFile -c CODE file % SetFile -c CODE some\ file % ./script ./file GetFileInfo: could not refer to file (-43) file Last edited by vonleigh; 06-16-2003 at 07:53 PM. |
|
|
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|