> From: Michael Havens <bmi...@gmail.com>
> Date: Mon, 22 Dec 2014 15:46:23 -0700
> 
> I was thinking, I could type in 'sudo apt-get update;sudo apt-get
> upgrade' but what would be a more efficient way?
> 
> [...]
> 
> sudo apt-get {update, upgrade}
> E: Invalid operation {update,
> 
> This is interesting: when I typed in 'sudo {apt-get {update; upgrade}}' it
> didn't give me an error for '{update'
> 
> So does anyone know what I'm talking about and how to do it?

Brace expansion is performed on a command.  A semicolon separates
commands.  Your command line

        sudo {apt-get {update; upgrade}}

is interpreted as two commands:

        sudo {apt-get {update
        upgrade}}

So sudo complains about a strange command name "{apt-get", the
argument "{update" passes without comment, and the shell complains
about the command name "upgrade}}".

You cannot stick an unescaped semicolon inside braces.

Most efficient?  Stick this in ~/.bashrc

        alias do-it='sudo sh -c "apt-get update; apt-get upgrade"'

so you can say just

        do-it

?
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss

Reply via email to