-2

I required to Echo following information but I am getting error.

echo Mumbai & Banglore 

But I am getting error as follows,

'Banglore' is not recognized as an internal or external command,
operable program or batch file.
muru
  • 69,900
  • 13
  • 192
  • 292
Vips
  • 1
  • 2
    The error message smells a bit like the windows command.com command line interface (esp. the mention of "batch files"). What system are you running exactly, and are you sure it's on topic on unix.SE? – ilkkachu Apr 19 '22 at 08:56
  • The error message is exactly the text reported if the command as shown is run at a Windows CMD prompt – roaima Apr 19 '22 at 09:55
  • In a shell script, `&` is a statement separator: `A & B` means to start execution of A in the background and then immediately start B. In your case, you are running `echo Mumbai` in the background and then start `Bangalore`. It seems that you don't have in your PATH an executable named _Bangalore_. However, as roaima and ikkachu already explained, you are not running a unix shell script at all, so this is the wrong place to ask anyway. – user1934428 Apr 20 '22 at 11:59

1 Answers1

1

You can change your command on this way to escape the ampersand:

echo Mumbai \& Banglore 

or use single quotes

echo 'Mumbai & Banglore'

In case of use cmd (Windows) you can use caret:

echo Mumbai ^& Banglore 
Romeo Ninov
  • 16,541
  • 5
  • 32
  • 44