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.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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