Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My shell script runs from the command line, but fails in cronjob.

/bin/sh: asper.sh: Permission denied

-rw-r--r-- asper.sh

I guess the permission should look like '-rwxr-xr--'

How can I change the permission to be like that?

share|improve this question

migrated from stackoverflow.com May 12 '11 at 4:38

This question came from our site for professional and enthusiast programmers.

    
chmod +x asper.sh. Also, this is not really a Stack Overflow question. Maybe superuser? Server fault? –  asveikau May 12 '11 at 4:27
    
chmod +x asper.sh will result in -rwxr-xr-x which will also work, but is not the permission setting asked for in the question. –  Trott May 12 '11 at 4:30

2 Answers 2

up vote 2 down vote accepted

If you want permissions to look like -rwxr-xr--:

chmod 754 asper.sh
share|improve this answer

If you just want to add the execute bit, it's as easy as:

chmod +x asper.sh
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.