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.

When I enter the following command in my mac OSX terminal i get a "permission denied" error even though I have administrative privileges.

Command:

administrators-Mac-mini-2:Build Foldername sarwan$ ./dpkg-scanpackages -m . /dev/null --> Packages

Error:

-bash: ./dpkg-scanpackages: Permission denied

EDIT: The Build I am trying to make is for an ios project thats why I included the iphone tag.I don't know if that helps or not.

EDIT 2 Thanks Gryphius your answer is correct.

share|improve this question

migrated from stackoverflow.com Dec 20 '12 at 16:57

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

2  
check if the file dpkg-scanpackes is executable –  Gryphius Dec 20 '12 at 12:07
    
@Gryphius write your answer in the answers section so that I can choose it as the correct Answer. –  IosBoy Dec 20 '12 at 12:33
    
done, thanks for accepting. –  Gryphius Dec 20 '12 at 13:02

2 Answers 2

up vote 3 down vote accepted

if a file is not executable you get this error even with administrative privileges. make your script executable and it should work

[root@boscos gryphius]# echo 'echo hello world!' > mytestscript.sh
[root@boscos gryphius]# ./mytestscript.sh
bash: ./mytestscript.sh: Permission denied
[root@boscos gryphius]# chmod 755 mytestscript.sh 
[root@boscos gryphius]# ./mytestscript.sh 
hello world!
share|improve this answer

Despite being logged in with administrative privileges, you usually need to use sudo at least once before you are granted these privileges through terminal (at least thats what I've found).

Try "sudo Build SGService sarwan$ ./dpkg-scanpackages -m . /dev/null --> Packages"

-Nick

share|improve this answer
    
I rather think sudo should be put in front of the real command, not in front of the prompt (which is, admittedly, not separated in a very readable way)... –  glglgl Dec 20 '12 at 12:21

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.