Does the ksh script explicitly define the path to awk? It could be via a variable ( AWK=/usr/bin/awk
, invoked by $AWK
). Try running which awk
and alias awk
, too.
Edit
Cygwin install process actually sets up /usr/bin
as a hardlink to /bin
. (Do ls -li /usr/
and ls -li /
and you'll see the bin
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
to dawk.exe
in windows and then set up a shortcut called awk.exe
pointing to it. Running awk
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?
As of now (9/7/2017) it is extremely easy to manually add rsync support to the Git for Windows environment without even having to resort to running the Git for Windows SDK.
I stumbled across this post and didn't think it could really be that easy given all the alternatives, but it really is. All you need to do is grab the rsync package from the MSYS2 Package repository and extract the rsync.exe
file into C:\Program Files\Git\usr\bin
. One and done. It works.
If you need help extracting rsync.exe
from the rsync package (which is in tar.xz
format), you can either use a compression utility like 7zip or do it directly within the Git for Windows bash environment like so:
cd /c/downloaded_location
tar -xvf rsync.pkg.tar.xz usr/bin/rsync.exe --strip-components=2
This gives you the rsync.exe
file in the downloaded location (adjust the package name accordingly). In light of Windows permissions issues I won't try to give specific commands on getting the exe into the C:\Program Files\Git\usr\bin
folder. You can copy it via an explorer GUI or via an elevated command line utility (and yes, it will require admin level permissions to copy something into the Program Files folders).
If you want to also use Pageant authentication with rsync over ssh, the ssh-pageant binary is already installed in Git for Windows and all you need to do is add a small bit to your ~/.bashrc
or ~/.bash_profile
file (see ssh-pageant usage section and Git for Windows wiki). I've modified it specifically for use with the Git for Windows environment and enhanced it with some detection for a missing socket file:
# ssh-pageant allows use of the PuTTY authentication agent (Pageant)
SSH_PAGEANT="$(command -v ssh-pageant)"
if [ -S "$SSH_AUTH_SOCK" ]; then
PAGEANT_SOCK=$SSH_AUTH_SOCK
else
PAGEANT_SOCK=${TEMP:-/tmp}/.ssh-pageant-$USERNAME
fi
if [ -x "$SSH_PAGEANT" ]; then
eval $("$SSH_PAGEANT" -qra "$PAGEANT_SOCK")
fi
unset SSH_PAGEANT
unset PAGEANT_SOCK
I can't speak to how other utilities might or might not work by manually installing them this way, but rsync appears to work just fine. Hopefully that repo will stay and continue to be updated--I'd think so because it's hosted at the official MSYS2 site.
Best Answer
Did you create the symbolic link with cygwin, or did you create it as a shortcut in windows? The links cygwin creates are compatible with windows, but shortcuts you create in windows aren't always compatible with cygwin unless you manually change them. See this.
Use
ln -s /bin/pdksh.exe /bin/ksh
in cygwin to create the symlink (see here).Edit: fixed link direction