I\'m trying to install PyQt4 so I can mess around with it. The installation guide said I had to install Sip. The last step to installing Sip is to use the make install
As you'll probably want to do this often, add aliases into your .bashrc file, like:
alias cdc='cd /cygdrive/c'
alias cdp='cd /cygdrive/p'
Then you can just type on the command line:
cdc
I'll add something that helps me out a lot with cygwin. Whenever setting up a new system, I always do this
ln -s /cygdrive/c /c
This creates a symbolic link to /cygdrive/c
with a new file called /c
(in the home directory)
Then you can do this in your shell
cd /c/Foo
cd /c/
Very handy.
Create a file named "overrideBashCdForWindowsPaths" in your HOME folder. Paste the following lines into that file and save it:
#!/bin/bash
function cd() {
CD_PATH="$(history | tail -1 | sed -e "s,.*${FUNCNAME[0]}\s*,,g")"
if [ -z "${CD_PATH}" -o "${CD_PATH}" = "~" ]; then
CD_PATH="${HOME}"
fi
builtin cd "$(cygpath "$CD_PATH")"
}
Next, type the following command in a terminal, while you are in your HOME folder:
echo ". overrideBashCdForWindowsPaths" >> .bashrc
Close your terminal and open a new one. You can now easily change into that Windows folder by simply typing
cd C:\Python31\sip
The script reads the last command, extracts the path and passes it to Cygwin's path-conversion tool. By naming the function "cd" we sort of 'override' Bash's builtin "cd" and delegate the actual call to it in the very last line.
cd c:
is supported now in cygwin
Something that is worth mentioning here is that Cygwin's cygpath
, still does not handle spaced Windows paths properly, especially in Bash scripts running under Cygwin. The trick is to understand how Cygwin
interprets quotes in Bash scripts.
The following does not work:
#!/bin/bash
TBDIR="/cygdrive/c/Program\ Files\ \(x86\)/MyDir/"
if [ -d "${TBDIR}" ]; then
echo "Found MyDir directory at: ${TBDIR}"
cd "$TBDIR"
else
echo "MyDir program directory not found!"
echo "Wrong DIR path: ${TBDIR}"
exit 1
fi
But this does work:
#!/bin/bash
# Cygwin-ism: No quotes!
TBDIR=/cygdrive/c/Program\ Files\ \(x86\)/MyDir/
if [ -d "${TBDIR}" ]; then
...
As far as I know, there is currently no known workaround using cygpath
, that can properly handle spaces in the bash scripting context but you can use quotes in your scripts.
Use:
cd /cygdrive/c