Reputation: 9404
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
Upvotes: 4
Views: 1605
Reputation: 385
I think the problem is that zsh is not interpreting ~/
correctly. You could replace ~/Documents
to /home/user/Documents
to solve the problem.
Upvotes: 6