You have a typo on line 13 If ($$1 == +ajon) { inc %aj | echo -a Autojoin On } "ajon" should be changed to ajoin