Article 6EQR4 The roots of an obscure Bourne shell error message

The roots of an obscure Bourne shell error message

by
Thom Holwerda
from OSnews on (#6EQR4)

Suppose that you're writing Bourne shell code that involves using some commands in a subshell to capture some information into a shell variable, AVAR=$(....)', but you accidentally write it with a space after the ='. Then you will get something like this:

$ AVAR= $(... | wc -l)sh: 107: command not found

So, why is this an error at all, and why do we get this weird and obscure error message? In the traditional Unix and Bourne shell way, this arises from a series of decisions that were each sensible in isolation.

I love these kinds of investigations.

External Content
Source RSS or Atom Feed
Feed Location http://www.osnews.com/files/recent.xml
Feed Title OSnews
Feed Link https://www.osnews.com/
Reply 0 comments