Posts tagged ‘cygwin’

calling native windows programs from cygwin with a sane path environment

some things fail if they’re called from within cygwin due to the path adjustments that are necessary for cygwin.

to call them with a sane (clean) windows-environment, do the following:

OLDPATH="$PATH"
export PATH="$(echo $PATH | tr ':' '\n' | grep /cygdrive | tr '\n' ':')"
 
call your windows tool here
 
export PATH="$OLDPATH"

YAY, install cygwin-packages from the cmdline

Migrating a cygwin-installation to a new machine was a real PITA to me, since I always have to run the installer many many times to have all the tools I forgot in the previous runs. And this terrible way of having to search them by clicking through the whole package-tree…

Since cygwin-1.7 it is possible to install packages from the commandline, without a single mouseclick:

setup.exe -q -P wget,make,patchutils,psmisc,git,git-svn,bc

Now to get a ready-to-use list of installed packages on an existing cygwin-installation, have a look in /etc/setup/installed.db:

tail -n +2 /etc/setup/installed.db  | cut -d ' ' -f 1 | xargs echo | sed 's/ /,/g'

which yields the following packages on my current system:

alternatives autossh base-cygwin base-files base-passwd bash bash-completion bc binutils bzip2 cmake cogito colordiff coreutils corkscrew cpio crypt csih cvs cvsps cygrunsrv cygutils cygwin cygwin-doc dash ddrescue diffutils e2fsprogs editrights expat file findutils gawk gettext git git-completion git-gui git-svn gitk grep groff gzip httptunnel ipc-utils less libapr1 libaprutil1 libbz2_1 libcurl4 libdb4.2 libdb4.5 libexpat1 libexpat1-devel libgcc1 libgdbm4 libgmp3 libiconv2 libidn11 libintl2 libintl3 libintl8 liblzma1 libncurses8 libncurses9 libneon27 libopenldap2_3_0 libpcre0 libpopt0 libpq5 libreadline6 libreadline7 libsasl2 libserf0_0 libsqlite3_0 libssh2_1 libssp0 libstdc++6 libwrap0 login make man minires multitail ncftp netcat openssh openssl patch patchutils perl perl-Error ping psmisc rebase rsync run rxvt sed subversion subversion-perl tar tcltk termcap terminfo terminfo0 texinfo tig time tzcode unison2.27 unison2.31 util-linux vim wget which whois xz zip zlib zlib-devel zlib0 zsync _update-info-dir

[UPDATE:]

while the above command works, there is a better alternative to obtain the list of installed packages – including their version: cygcheck

cygcheck -cd

set rxvt title from shell

set the rxvt title using a shell-command:

printf \\033]0\;\%s\\007 "$title"

using this e.g. as bin/set_rxvt_title, you can push even a cygwin-rxvt-ssh session to dynamically change the window-title to the host you connect to. put this into your “~/.ssh/config“:

PermitLocalCommand yes
LocalCommand $HOME/bin/set_rxvt_title %h