On Tuesday, December 22, 2020 at 11:26:46 AM UTC+8, Keith Thompson wrote:
> Javier <inv...@invalid.invalid> writes:
> >
hongy...@gmail.com <
hongy...@gmail.com> wrote:
> >> When using command to run a cmd, I want to pass variables to it as
> >> shown below:
> >>
> >> $ foo=bar command cmd [arg ...]
> >>
> >> I'm not sure whether this is possible or not. Any hints will be
> >> highly appreciated.
> >
> > You can do that. When there is more than 1 or 2 options using variables
> > makes faster writing code instead of writing a CLI parser with the
> > getopts builtin or getopt(1). I do that very often for scripts that
> > *I only use myself*.
> [...]
>
> I think you missed the point of the question. The OP is asking about
> the "command" command, a built-in command in bash (and probably other
> shells, I haven't checked), not about commands in general.