-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
dereferencing an undefined variable should be an error #4163
Copy link
Copy link
Open
Labels
Milestone
Description
It would make fish a safer shell if we made dereferencing an undefined variable an error. This would also be consistent with our failglob behavior. See issue #805 and this comment in the issue discussing whether we should do a major release. The example from that comment:
> set hippopotamus
> ls $typopotamus
fish: $typopotamus is not defined.
ls $typopotamus
^
Note that using an index that doesn't exist would still silently substitute nothing. That is, this would still be legal and work like it does today:
> set var a
> echo "var[2]=$var[2]:"
var[2]=:
Reactions are currently unavailable