Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Console Foundations Environment and Redirection Environment Variables

Amit Jotwani
Amit Jotwani
2,557 Points

PS1: command not found

Why am I getting a "-bash: PS1: command not found" error when trying to set the value of that variable?

2 Answers

Amit Jotwani
Amit Jotwani
2,557 Points

I think I may have an answer to my question. Turns out the commands for setting up environment variables through the command line is whitespace sensitive. So, they should be typed as -

PS1="> "

instead of PS1 = "> "

Li Mbo
Li Mbo
5,096 Points

Yeah! now it works on iTerm as well, we were fooled :v, there was even a question for it, happy learning Amit!

Li Mbo
Li Mbo
5,096 Points

For me it works under terminal on Mac OS X, however it does not work under iTerm 2 which is a replacement for the terminal that offer some features to save time.

Amit Jotwani
Amit Jotwani
2,557 Points

Aha. That's a great point. Let me try it out on Terminal. Didn't realize I was using iTerm as well :)

UPDATE: Get the same error even on Terminal :(