Ask coding questions

← Back to all posts
Chatbot
IondonAtSchool

I made this chatbot, and the way it's supposed to function is that you input your favorite color, but it's only giving me this error message.

sh: 1: color: not found

What's wrong?
I think it has something to do with lines 20 and 21, but I'm not sure.

Voters
IondonAtSchool
Comments
hotnewtop
19ecal

That error is because in the shell that system calls, there isn't a command color. To make the terminal text red, you can use

more info on ANSI escape sequences (which is what this solution uses)

IondonAtSchool

@19ecal thank you!