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:

I also tried adding #!/bin/bash to the top of kc and continued getting the same issue
I think the problem is that zsh is not interpreting ~/ correctly. You could replace ~/Documents to /home/user/Documents to solve the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With