Is there an argument to find that will by-pass the aliases.
Alternately, is there another way to find the root files and to apply a
shell script to them?
I forgot. The typical way this is used is as follows:
Category/alias to file
Category/YYYY/alias of file
Category/YYYY/MM/alias of file
Category/YYYY/MM/DD/file
I want to be above the Category and only find Category/YYYY/MM/DD/file.
If you have Xcode installed, you can use /Developer/Tools/GetFileInfo
with the -a switch in your script to get a list of file attributes for
each file. If the returned attribute string contains a capital letter A,
the file is an alias file.
For example executing this command on an alias file should return a
attribute string containing the capital letter A:
/Developer/Tools/GetFileInfo -a my/known/alias/file
--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.
JR
> If you have Xcode installed, you can use /Developer/Tools/GetFileInfo
> with the -a switch in your script to get a list of file attributes for
> each file. If the returned attribute string contains a capital letter A,
> the file is an alias file.
>
> For example executing this command on an alias file should return a
> attribute string containing the capital letter A:
>
> /Developer/Tools/GetFileInfo -a my/known/alias/file
Thanks. That works (without the -a). Now I have to figure out the best
way to use it.
> In article <jollyroger-6015F...@news.individual.net>,
> Jolly Roger <jolly...@pobox.com> wrote:
>
> > /Developer/Tools/GetFileInfo my/known/alias/file
>
> Thanks. That works. Now I have to figure out the best
> way to use it.
Turned out to be pretty simple. In ksh
if [ "$(/Developer/Tools/GetFileInfo "$1"|grep attributes|grep A) ]
then
exit
fi
apply-the-command "$1"
I could just as easily have used '!' and replaced exit with the command,
but I did it this way first and it worked. Then,
find . -name pattern -exec the-above-script {} \;
Ermm... It works with the -a switch as well. In fact, the -a switch
makes it so that your script only has to look at *one* line of output as
opposed to several, so it's more efficient:
# GetFileInfo Home
file: "/Users/you/Desktop/Home"
type: "fdrp"
creator: "MACS"
attributes: AvbstClinmedz
created: 10/25/2009 10:49:14
modified: 10/25/2009 10:49:14
# GetFileInfo -a Home
AvbstClinmedz