Computing.Net > Forums > Solaris > Sudo Here document

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Sudo Here document

Reply to Message Icon

Name: VitaCarrot
Date: August 29, 2007 at 13:12:59 Pacific
OS: Solaris
CPU/Ram: 100000
Product: Sparc
Comment:

I'm trying to create a here document to automate the sudo command. Anyone have any experience with this? This is what I have but it's not working, it still prompts for password:

!/usr/bin/ksh

scsudo - root pkgadd <<HereDoc
password
HereDoc



Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: August 29, 2007 at 13:29:28 Pacific
Reply:

Typically, for this type of problem, you have to use expect:

http://expect.nist.gov/


0

Response Number 2
Name: VitaCarrot
Date: August 29, 2007 at 19:10:01 Pacific
Reply:

Thanks for the reply, I actually found the "empty" command and it might prove more useful.

http://empty.sourceforge.net/

In my case I think it would be best to stay away from any external tools.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Solaris Forum Home


Sponsored links

Ads by Google


Results for: Sudo Here document

Password changing www.computing.net/answers/solaris/password-changing/2262.html

Install Apps with Jumpstart www.computing.net/answers/solaris/install-apps-with-jumpstart/1535.html

Passing args from 1script to anothr www.computing.net/answers/solaris/passing-args-from-1script-to-anothr/5019.html