help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please help clarify bash this common found code


From: Andreas Kähäri
Subject: Re: Please help clarify bash this common found code
Date: Fri, 20 Oct 2023 09:03:00 +0200

On Fri, Oct 20, 2023 at 01:33:03PM +0700, Budi wrote:
> Please help clarify bash this common yet doubtful line
> 
> So often read or found a variable definition (or/and declaration) is
> at the start preceding every command/code, one terminated by shel
> terminator the other not
> 
> This merely illustration, what is the definitive function/behaviour on
> e.g. each of
> 
> FOO=bar ; find /usr

This sets the shell variable FOO to the string "bar" and then
executes the command "find /usr".  If the variable is exported,
it will be visible for the "find" process and any processes it
may spawn, otherwise it's not.

> 
> and
> 
> FOO=bar  make Makefile

This sets the shell variable FOO to the string "bar" in the environment
of the "make" command.  It will be visible as an environment variable to
"make" and any processes it may spawn. The variable is *not* set in the
environment of the current shell.

> 
> Please crystal clearly elaborate it

-- 
Andreas (Kusalananda) Kähäri
Uppsala, Sweden

.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]