[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Effect of prefixed assignments on built-ins
From: |
Jens Schmidt |
Subject: |
Effect of prefixed assignments on built-ins |
Date: |
Sun, 30 Jun 2024 19:18:13 +0200 |
User-agent: |
Mozilla Thunderbird |
Hello list,
I always get baffled about the following difference in behavior:
[~]$ echo $BASH_VERSION
5.2.15(1)-release
[~]$ IFS=foo read a b c <<< "afbocoo"
[~]$ echo "<$a:$b:$c>"
<a:b:coo>
[~]$ IFS=foo export | grep IFS
<no result>
Both "read" and "export" are built-ins, but the prefixed assignment
"IFS=foo" affects only "read".
Why?
Special case or general rule? If the latter, which?
I couldn't find anything in the man page explaining that. I also have
tried searching the net, but the search terms I tried are all a bit too
general to give helpful results.
Please CC me when replying.
Thanks!
- Effect of prefixed assignments on built-ins,
Jens Schmidt <=