If that's not it, it may be that your unquoted one is expanding into
something Bash believes is an assignment plus a command because you have a
semicolon in the value of $1.

Well, but that's not it because 'free' is a command (usually), and it's
saying the command not found is "OK: ...".

This can only mean $ECHO evaluates to nothing (empty string).  Thus "$1:
${2:0}" is trying to be run as a command (since it is now the first word in
that line), which obviously doesn't exist.  So, initialize ECHO.

On Tue, Dec 16, 2014 at 5:16 PM, Matthew Larsen <[email protected]> wrote:

> On Tue, Dec 16, 2014 at 4:35 PM, Nicholas Leippe <[email protected]> wrote:
> >
> > "${!var}"
> > *Expand the value of the parameter named by the value of the parameter
> > var*.
> > This is *bad practice*! This expansion makes your code highly
> > non-transparent and unpredictable in the future. You probably want an
> > associative array instead.
> >
>
> Thanks for the explanation.  The script is from a Nagios plug-in I found on
> the Nagios exchange.   I hadn't seen the "!" in the "${!var}" expression
> before and couldn't find reference to it in my books or online.  I think
> I'll just take it out and modify it to something that works and makes sense
> for my purpose.
>
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
>

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to