PREV INDEX NEXT

Author: Unknown
Subject: Hwk3 Clarification
Date: Tuesday, 20 Oct 2020, 16:30:50

The doc says "Replace by the value of the environment variable NAME, or by the expansion of WORD if NAME is not defined (in which case NAME is immediately assigned the expansion of WORD)." Then, in the Notes, it says "However, if NAME exists, then during the expansion mcBash must suppress any assignments to environment variables and must ignore errors other than a missing }"

Why would we expand WORD in the first place if NAME exists? My logic is to check if NAME has a value, if it does, output it. If it doesn't, only then expand. Is this valid?
PREV INDEX NEXT