<div dir="ltr">I understand! thank you.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">:-)~MIKE~(-:</div></div>
<br><div class="gmail_quote">On Tue, Dec 23, 2014 at 1:45 AM, Kevin Fries <span dir="ltr"><<a href="mailto:kevin@fries-biro.com" target="_blank">kevin@fries-biro.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">The brackets expand in place.  It does not expand your command, but instead the parameters.  Let's say I wanted to create a list of direcrories.   I could do something like this</p>
<p dir="ltr">$ mkdir -p a/{b,c/{d,e,f}} </p>
<p dir="ltr">This expands to</p>
<p dir="ltr">$ mkdir -p a/b a/c/d a/c/e a/c/f</p>
<p dir="ltr">Sidenote... what if you wanted a directory named abc and second one abcde?</p>
<p dir="ltr">$ mkdir -p abc{,de}</p>
<p dir="ltr">The comma with nothing before it, gives you abc, and the de after the comma gives you abcde</p>
<p dir="ltr">Does this make more sense?  apt-get is your command, and update and upgrade are the parameter to the command.  When you were using the curley brackets, you were expanding a single command with two incompatible parameters.</p>
<p dir="ltr">Hope this makes sense.</p><span class="HOEnZb"><font color="#888888">
<p dir="ltr">Kevin<br>
</p></font></span><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Dec 23, 2014 12:09 AM, "Michael Havens" <<a href="mailto:bmike1@gmail.com" target="_blank">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 so much. the way I figure it 'apt-get' is the command I'm expanding. But the command must be 'apt-get update, and 'apt-get upgrade'.<div class="gmail_extra"><br clear="all"><div><div>:-)~MIKE~(-:</div></div>
<br><div class="gmail_quote">On Tue, Dec 23, 2014 at 12:03 AM, Kevin Fries <span dir="ltr"><<a href="mailto:kevin@fries-biro.com" target="_blank">kevin@fries-biro.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><span><font color="#888888">
<p dir="ltr">Kevin</p></font></span><div><div>
<div class="gmail_quote">On Dec 22, 2014 11:55 PM, "Michael Havens" <<a href="mailto:bmike1@gmail.com" target="_blank">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" 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>
</div></div><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></div>
<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>
</div></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><br></div>