6
Bash error messages sometimes have a -bash:
or 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?
I'd say it's the opposite – your 2nd example doesn't match any bash version I have here. – user1686 – 2018-06-27T10:21:10.117
bash
in my Kubuntu behaves like in the question; the same in Debian. In Raspbian, however, the pattern is like in the other question. The versions are4.3.48
,4.4.12
and4.3.30
respectively. – Kamil Maciorowski – 2018-06-27T10:37:50.597After reading above comments, I have updated the question with bash version number and with test results from a different system. – RedGrittyBrick – 2018-06-27T14:00:57.347