0

I'm having some issues with my prompt (https://gist.github.com/zackp30/ccf91d6e476f1b6b8ec4), it only displays "anothertest", but it should toggle on every command, and, if this helps, $PS1 is set to "anothertest", and not the _zprompt_init function, any help will be greatly appreciated, I have also made sure prompt_subst is set. Thanks, Zack.

Xack
  • 55
  • 6

1 Answers1

0

The error is in the comparison in line 10:

if [[ a == 1 ]] ; then

it has to be:

if [[ $a == 1 ]] ; then

In order to recall the value of parameters you have to prepend $ to their name.

Adaephon
  • 16,929
  • 1
  • 54
  • 71
  • Thanks! I'm very new to shell script, still used to not prepending $ to variables, thanks again! – Xack Feb 25 '14 at 11:26