Length of File Name

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Length of File Name Fri May 30, 2014 6:05 pm • by learned
I am trying to flag files which have file names > 150 characters. I'm using the following embedded bash script as a test.

Code: Select all
string="$1"
 
length=$(echo ${#string})

if [ $length -gt 150 ]
then
   exit 0
fi

exit 1


It seems as it should work, but long file names still seem to not get flagged. Any ideas of how to accomplish this?
learned
 
Posts: 29
Joined: Sun Jun 21, 2009 5:18 pm

Re: Length of File Name Mon Jun 02, 2014 3:20 pm • by Mr_Noodle
You'll have to debug this outside of Hazel first, then within Hazel using prints and such to see what's going on.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support