1

I previously worked at a company who heavily used KDB (q) in their workflow. That's why I used this official article to install it. Using 5th step (Step 5: Edit your profile), I added this alias alias q='QHOME=~/q rlwrap -r ~/q/m64/q' to my .zshrc file, and sourced it.

After a while, I decided to remove kdb from my system, so I deleted all the necessary files and removed the line alias q='QHOME=~/q rlwrap -r ~/q/m64/q' from my .zshrc, and again I used source to activate this change.

But for some reason, the alias q is still appearing to exist, even after that (sytax highlighting of my terminal also proves that). Now, hovewer, after executing q, I'm getting the error because I removed the necessary files for it to run properly:

❯ q                                                                                                        
rlwrap: error: Cannot execute /Users/*****/q/m64/q: No such file or directory

Can somebody please explain what's going on? How do I completely and permanently get rid of this alias?

5
  • unalias q. Explanation here (for bash, but in this case it also applies to zsh): stackoverflow.com/questions/66483407/…
    – Gairfowl
    Commented Jul 1 at 11:41
  • 1
    source does not "activate changes", it runs the commands in a file. There used to be a command in your .zshrc to create q as an alias, so when you sourced the file it created that alias. The file no longer contains that command, so sourceing it doesn't create that alias anymore... but it doesn't delete it either, so the alias is still set in your shell. Either unalias it or just create a new shell that doesn't have the alias. Commented Jul 1 at 20:42
  • I used unalias q, stopped all terminals, reloaded my computer, - nothing helped. It is still there =( Commented Jul 2 at 10:16
  • Try type q, make sure that q is indeed an alias. If it's still showing up in a new shell, then it is being set in one of the startup files.
    – Gairfowl
    Commented Jul 2 at 22:25
  • I have this output after typing type q: q is an alias for QHOME=~/q rlwrap -r ~/q/m64/q It seems that it is indeed a valid alias. But there is no a single string that could cause that in the startup files that you provided. Anyways, thank you Commented Jul 3 at 12:22

1 Answer 1

0

Ok, so the thing is - I also used oh-my-zsh - and it seems that the alias was simply present in one of its custom setup scripts called .oh-my-zsh/custom/aliases.zsh. So I removed it from there, reloaded the shell and it finally gone.

Thanks Gairfowl and Gordon Davisson, your support is appreciated!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .