This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Batch file code to launch rxvt pointed elsewhere than $HOME -- what's wrong with my code?

SJ Wright:
> I'm trying to write batch scripts of the kind that start a Cygwin session in
> rxvt from the desktop, with the added feature that the session starts in a
> folder other than $HOME. I want to do this for two folders I use often.
> I know urxvt has a -cd command, and thought rxvt in Cygwin did too. I tried
> this code
>> @echo off
>> C:
>> chdir C:\cygwin\bin
>> start rxvt -display :0 -sl 2500 -sr -tn rxvt-cygwin-native -geometry 80x25
>> -font "Bitstream Vera Sans Mono-14" -e /bin/bash --login -i -cd
>> /cygdrive/c/blu/newest/

You've got the -cd in the wrong place. Everything after the -e is
taken as the command to execute, i.e. you're passing the -cd to bash
rather than rxvt. Bash doesn't recognise it and therefore exits
immediately with an error.

But even if you put the '-cd <path>' before the -e it won't work as
you expect because the default /etc/profile contains a 'cd $HOME'
command. Instead of using -cd, though, you could set HOME in your
batch script:

set HOME=C:\blu\newest

Or you could change your home directory in /etc/passwd.


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]