help-bash
[Top][All Lists]
Advanced

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

The difference between `X=x f | cat` and `{ X=x; f; } | cat`


From: Peng Yu
Subject: The difference between `X=x f | cat` and `{ X=x; f; } | cat`
Date: Thu, 19 Jan 2023 08:02:07 -0600

Hi,

f is a function that uses a variable called X, which is not declared in f.

As far as I can tell, the following two ways produce the same results.

- `X=x f | cat`
- `{ X=x; f; } | cat`

What is their difference under the hood? Is there any timing
difference between the two calls?

-- 
Regards,
Peng



reply via email to

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