Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Edit: echo and sudo used together as shown below can have unexpected consequences. Please avoid such usage as far as possible.

I'm on Lubuntu 12.10 fully updated.

I know that what I'm asking could be a security risk but I would still like to understand what's happening.

I can get the following aliases to work:

fast='echo "mypassword" | sudo -S apt-fast update && sudo apt-fast upgrade'
nm='echo "mypassword" | sudo -S service network-manager restart'
aalog='echo "mypassword" | sudo -S aa-logprof'
reloadsm='echo "mypassword" | sudo -S apparmor_parser -r /etc/apparmor.d/usr.local.seamonkey.seamonkey'
reloadgc='echo "mypassword" | sudo -S apparmor_parser -r /etc/apparmor.d/'

But when I try this alias

pua='echo "mypassword" | sudo -S nano /etc/privoxy/user.action'

I see this:

[12:32 PM] ~ $ pua
Received SIGHUP or SIGTERMa: 
[12:32 PM] ~ $ 

Can someone please explain why this happens and if there's a way to fix the error-giving alias?

(I don't want to do anything involving sudoers.)

share|improve this question
up vote 0 down vote accepted

It's a problem with nano, not the alias. Try using vim.

share|improve this answer
Could you please provide a link for that? – user25656 Nov 29 '12 at 8:11
Why, did it work? :P – penner Nov 29 '12 at 8:12
I can't find any resources but it seems the OS is killing the process off after you start it up or nano is running out of memory. – penner Nov 29 '12 at 8:25

Your Answer


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