You can not return a string. You must return a numeric value. So changing "$fileName__0" to something like 0 would work.
L7Sqr
Practically a Posting Shark
849 posts since Feb 2011
Reputation Points: 253
Solved Threads: 155
Skill Endorsements: 7
You can of course "return" a string like this.. which is not really returning and it forces you to ensure that there are no unwanted `echo`s in the function.. but it works.. :)
#!/bin/bash
function gimme_string() {
echo "returned string"
}
my_string=`gimme_string`
echo "String I got is: $my_string"
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
Skill Endorsements: 0