Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a script to install imagemagick on MacOSX Lion. Periodically it will halt progress to ask for the root password, which I enter and everything is great. But there was one point where it asked, and I wasn't paying attention and because I didn't respond in time (surprised there is a time limit here) it halted execution. So is there a way to pass along a flag that says use this password when asked when running a shell script?

share|improve this question

closed as off topic by Sven, mdpc, Ward, Bryan, voretaq7 Dec 16 '12 at 19:17

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Is it at all possible to run the script as root? If not, we need more details. I.e., is this a bash or python script? –  Publiccert Feb 15 '12 at 19:03

1 Answer 1

up vote 3 down vote accepted

Just use a sane tool to install ImageMagick. Either Homebrew or MacPorts will not ask for a password more than once (when started with sudo). Both have the advantage to allow easy removal of installed software.

Starting your script with sudo might be another way to prevent it to ask for the password more than once.

share|improve this answer

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