problem with sudo in terminal

Joined
Mar 25, 2010
Messages
5
Reaction score
0
i have these aliases that utilize sudo so that i can type one thing instead of having to type my password every time. only when i open up terminal from a closed state, the automatic sudo doesn't work! let me illustrate what i mean.

i type "emptytrash" to clean out everything from my trash, and that calls 'echopass rm -rf /Users/me/.Trash/*'. echopass itself is an alias, 'echo '(my password)' | sudo -S'. so combined, that's 'echo 'my password' | sudo -S rm -rf /Users/me/.Trash/*'. echoing my password makes that the standard input, then sudo -S takes the standard input and uses that to validate the sudo, and then the rest happens.

i know how unsecure having my pw in my .bash_profile is, so let's not talk about that. the issue is that when i type 'emptytrash', terminal prompts for my password 3 times, failing each time. but when i type the command and subsequently the password myself, everything works. i've checked many times and the password is FOR SURE correct. one cause could be the upgrade to snow leopard... i don't remember if this issue cropped up immediately after the upgrade, but it definitely wasn't happening before i did it. it wouldn't surprise me, i think i had to change a couple other things through my terminal because of the upgrade.

then, if that's the case, what do i change the script to?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top