I run a .ksh containing a awk call. awk.exe and his shortcut awk is in /bin/awk, /bin is in the PATH environment variable. But when I try to launch awk, I have this error message :
bash: /usr/bin/awk: no such file or directory
Why didn't bash look for it in the /bin folder too?
edit : tar has the same rights, tar.exe is in /bin and can be listed in /usr/bin/, the exact same way than awk. Tar works fine whereas awk not.
Best Answer
Does the ksh script explicitly define the path to awk? It could be via a variable (
AWK=/usr/bin/awk
, invoked by$AWK
). Try runningwhich awk
andalias awk
, too.Edit
Cygwin install process actually sets up
/usr/bin
as a hardlink to/bin
. (Dols -li /usr/
andls -li /
and you'll see thebin
folders have the same inode number. Also, browse to the /usr/bin folder in windows explorer and you'll see it's empty.)Your PATH is probably fine, but probably has
/usr/bin
before/bin
, so it's finding awk via that route first.Looking at your previous question, I think you might have a similar, shortcut related issue here. I tried renaming my
awk.exe
todawk.exe
in windows and then set up a shortcut calledawk.exe
pointing to it. Runningawk
then gives me the same error you can see. I had to force that issue, though; I think your Cygwin installation might be a bit broken, but it's hard to say how. Do you get similar errors from any other binaries?