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

Re: bash syntax question

Alfredo Finelli schrieb:
The 'date' command runs in a child process for which the bash shell has to determine the environment. Parameter assignments are inherited in that environment (i.e. the 'date' command sees them) in two cases: either when the variable is not only declared but also exported or when the assignment is provided on the command line right before the command itself. From the man page:

  The environment for any simple command or function  may
  be  augmented temporarily  by  prefixing  it with parameter
  assignments, as described above in PARAMETERS.  These assignment
  statements affect only the environment seen by that command.

For more information you may want to read the "Command execution environment" section in the Bash man page.

Alfrede, thanks for your help! No I understand. And its good to know that I'm using an official feature :-)

Reply to: