Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZSH command not found, even if command is in my $PATH

Tags:

bash

shell

path

zsh

So I have a script called kc which compiles Kotlin files into a jar.

The file is located at ~/Documents/KotlinPlayground/bin and my $PATH looks like this:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/Documents/KotlinPlayground/bin:~/Library/Android/sdk/platform-tools/

when I just type kc SomeFilt.kt into the command line I get a zsh: command not found: kc, but if I type in ~/Documents/KotlinPlayground/bin/kc SomeFile.kt it works.

So how come zsh can't find my script even though its in the path?


Here is an image showing the problem:

enter image description here


I also tried adding #!/bin/bash to the top of kc and continued getting the same issue

like image 532
Quinn Avatar asked Oct 23 '25 09:10

Quinn


1 Answers

I think the problem is that zsh is not interpreting ~/ correctly. You could replace ~/Documents to /home/user/Documents to solve the problem.

like image 185
B. Almeida Avatar answered Oct 25 '25 02:10

B. Almeida



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!