Bash error messages sometimes have a
bash: prefix, sometimes none.
Consider these error messages from Ubuntu 14.04.5 Trusty Tahr with bash 4.3.11(1)
$ type encabulator -bash: type: encabulator: not found $ encabulator encabulator: command not found $ bash -c encabulator bash: encabulator: command not found
In another question, someone reports seeing a message
-bash: fetch: command not found.
Which doesn't match the pattern expected when "fetch" is simply a program that has not been installed.
After comments below, I tried using bash 3.2.25(1) on Centos 5.7 - which behaves slightly differently
$ type encabulator -bash: type: encabulator: not found $ encabulator -bash: encabulator: command not found $ bash -c encabulator bash: encabulator: command not found
So I guess the message from the other question means exactly what I first thought, before my test with bash 4.3.11 confused me.
It still leaves open the question of whether the bash maintainers intended to apply some consistent system to the structure of these text messages?
When exactly does bash prefix error messages with
-bash: and when with
bash: (what does the leading hyphen indicate?)
I couldn't find answers using a simple search in
man bash but maybe there's a section that provides an explanation?