Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Actually....' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Actually....
Authored by: hjeff on Sep 07, '03 01:57:08PM

Here's a simple shell command contribution. Gives a thumbs-up or down on whether it finds an NS string anywhere in a application folder (Program.app). I made it return a 1 or a 0 so it could be used with other programs easily, but season to taste.

#!/bin/sh
fileIn=$1
cocoaCount=`grep -rIh 'NS' "$fileIn" | wc -l`
if [ $cocoaCount -ge 1 ]
then
    echo 1
else
    echo 0
fi


[ Reply to This | # ]
Actually....
Authored by: hjeff on Sep 10, '03 04:02:15PM
I can't figure out how to edit that old entry, but here's a better version of the above (the one above gave false positives) :
#!/bin/sh
filein=$1
cocoaCount=`grep -rIh 'NS' "$filein" | grep -v Java | wc -l`
javaCount=`grep -rIh 'Java' "$filein" | wc -l`
if [ $cocoaCount -ge 1 ]
then
        echo "cocoa"
elif [ $javaCount -ge 1 ]
then
        echo "java"
else
        echo "carbon"
fi


[ Reply to This | # ]