<p dir="ltr">Michael,</p>
<p dir="ltr">As Matt said, braces expand into the same command, they are not used for multiple commands. FOR is used for multiple commands. While this is much more work in my opinion, this would also work... provided that there is no error.</p>
<p dir="ltr">$ for cmd in update upgrade; do sudo apt-get ${cmd}; done</p>
<p dir="ltr">This runs the two command in serial regardless of the results of either command. My original answer did not run the second command if the first command failed.</p>
<p dir="ltr">Kevin</p>
<div class="gmail_quote">On Dec 22, 2014 11:55 PM, "Michael Havens" <<a href="mailto:bmike1@gmail.com">bmike1@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">thank you Matt and Kevin. I was looking for a way to combine the two commands with the curly brackets.</div><div class="gmail_extra"><br clear="all"><div><div>:-)~MIKE~(-:</div></div>
<br><div class="gmail_quote">On Mon, Dec 22, 2014 at 11:36 PM, Matt Birkholz <span dir="ltr"><<a href="mailto:matt@birchwood-abbey.net" target="_blank">matt@birchwood-abbey.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> From: Michael Havens <<a href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>><br>
> Date: Mon, 22 Dec 2014 15:46:23 -0700<br>
<span>><br>
> I was thinking, I could type in 'sudo apt-get update;sudo apt-get<br>
> upgrade' but what would be a more efficient way?<br>
><br>
</span>> [...]<br>
<span>><br>
> sudo apt-get {update, upgrade}<br>
> E: Invalid operation {update,<br>
><br>
> This is interesting: when I typed in 'sudo {apt-get {update; upgrade}}' it<br>
> didn't give me an error for '{update'<br>
><br>
> So does anyone know what I'm talking about and how to do it?<br>
<br>
</span>Brace expansion is performed on a command. A semicolon separates<br>
commands. Your command line<br>
<br>
sudo {apt-get {update; upgrade}}<br>
<br>
is interpreted as two commands:<br>
<br>
sudo {apt-get {update<br>
upgrade}}<br>
<br>
So sudo complains about a strange command name "{apt-get", the<br>
argument "{update" passes without comment, and the shell complains<br>
about the command name "upgrade}}".<br>
<br>
You cannot stick an unescaped semicolon inside braces.<br>
<br>
Most efficient? Stick this in ~/.bashrc<br>
<br>
alias do-it='sudo sh -c "apt-get update; apt-get upgrade"'<br>
<br>
so you can say just<br>
<br>
do-it<br>
<br>
?<br>
---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br>
</blockquote></div><br></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div>