WaxfordSqueers
March 16th, 2008, 16:06
Just kidding about the path. I'm wondering if it's appropriate to ask a question about the bash shell in here, even though it's used in Cygwin (a windoze-based Unix os). It is a reversing-related question since I'm reversing Paimei, using softice, to help me see why it wont work on my system. To help me with the dense Python code, I am building a debug version of Python. Since many of the Python makefiles, in wxWindows and wxPython, are Unix based, I loaded Cygwin, and had to dig into the unix os to understand what was going on.
I had the path working really well in bash, but it went AWOL. If I use 'printenv PATH', it only shows the Cygwin path, and not the Windows path. Before, it showed the windows sys path, then the windows user path, then the Cygwin path. This is important to me because I need the Visual Studio path at the front. Otherwise, Cygwin tried to use the gcc compiler, since it's first in the path.
I'm using this scripted path statement in bashrc in my home directory:
The 'cygdrive' references, for anyone unfamiliar with Cygwin, are Cygwin's way of mounting drives in the Windows system. I don't get the warning message at the bottom and I don't get the windows path ($PATH).
I had to put the Visual Studio path at the front because bash no longer appends the Windows path at the front. Can anyone see why? The 'do' statement covers that, and it should append the $path (windows path).
Another problem peculiar to Cygwin has to do with the usr/bin directory. I Googled this problem and saw references to it but no solutions. If I go into /usr or usr/bin, I can see files in there using ls -l. In windows, I can see the directories, but no files show up. In fact, in a Cygwin shell working out of a windows directory, bash can't find files in usr/bin. I'm wondering if that happens in Linux/Unix as well.
It was mentioned that /usr/bin is being linked with /bin in the Cygwin root and that the solution was to remount /usr/bin, but I don't have enough info to have the confidence in that solution.
I had the path working really well in bash, but it went AWOL. If I use 'printenv PATH', it only shows the Cygwin path, and not the Windows path. Before, it showed the windows sys path, then the windows user path, then the Cygwin path. This is important to me because I need the Visual Studio path at the front. Otherwise, Cygwin tried to use the gcc compiler, since it's first in the path.
I'm using this scripted path statement in bashrc in my home directory:
Code:
unset PATH
for i in \
/cygdrive/k/"Visual Studio 9.0"/VC/bin \
/cygdrive/k/"Visual Studio 9.0"/VC/include \
/cygdrive/k/"Visual Studio 9.0"/VC/lib \
/cygdrive/k/"Visual Studio 9.0"/Common7/IDE \
/cygdrive/d/"Program Files"/"Microsoft SDKs"/windows/v6.0A/bin \
/cygdrive/d/"Program Files"/"Microsoft SDKs"/windows/v6.0A/include \
/cygdrive/d/"Program Files"/"Microsoft SDKs"/windows/v6.0A/lib \
~/ \
/bin \
/usr/X11R6/bin \
/cygdrive/i/wx/src/msw \
/cygdrive/i/wx/lib/vc_dll \
/cygdrive/i/wx/include/wx/msw \
/cygdrive/i/wx/build/msw \
/cygdrive/i/wx/wxpython \
/cygdrive/d/WINXP/ \
/cygdrive/d/WINXP/system32 \
/cygdrive/d/WINXP/System32/Wbem \
/cygdrive/d/Program\ Files/Support\ Tools \
/cygdrive/d/WINXP/Microsoft.NET \
/cygdrive/d/WINXP/Microsoft.NET/Framework \
/usr/bin \
/usr/local/bin
do
if [ -d "$i" ] ; then
if [ -z "$PATH" ] ; then
PATH=$i
else
PATH="$PATH:$i"
fi
else
echo "Warning: can't append $i to PATH because it doesn't exist."
fi
done
export PATH
The 'cygdrive' references, for anyone unfamiliar with Cygwin, are Cygwin's way of mounting drives in the Windows system. I don't get the warning message at the bottom and I don't get the windows path ($PATH).
I had to put the Visual Studio path at the front because bash no longer appends the Windows path at the front. Can anyone see why? The 'do' statement covers that, and it should append the $path (windows path).
Another problem peculiar to Cygwin has to do with the usr/bin directory. I Googled this problem and saw references to it but no solutions. If I go into /usr or usr/bin, I can see files in there using ls -l. In windows, I can see the directories, but no files show up. In fact, in a Cygwin shell working out of a windows directory, bash can't find files in usr/bin. I'm wondering if that happens in Linux/Unix as well.
It was mentioned that /usr/bin is being linked with /bin in the Cygwin root and that the solution was to remount /usr/bin, but I don't have enough info to have the confidence in that solution.