You may want to check on if the file in question has execute rights. You do that with the -x option:
Code:
#!/bin/sh
if [ -x $file ]
then
print " $file exists - executing..."
$file
else
if [ -f $file ]
print " $file exists - but I need to pass it to the shell to run..."
/bin/sh $file
fi
fi
Hope this helps. Einstein47 ("For every expert, there is an equal and opposite expert." - Arthur C. Clarke)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.