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?


Sorry that question went out from the wrong email box. I must have
subscribed before on sjwright68u@charter.net or I wouldn't have caught
Andy Koppe's reply on nabble:

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.
It was also on nabble that I found the thread I mentioned briefly in the
mis-sent email that included my original question.
http://old.nabble.com/How-to-run-bash-in-rxvt-with-both-login-shell-and-in-a-specific-directory--td25369374.html

Mark J. Reed and Gary Johnson were replying to a member named David Karr
with suggestions and advice that included the following code that seems
to work in the Command Prompt
C:\cygwin\bin\rxvt.exe -cd "/cygdrive/c/blu/newest" -e /usr/bin/bash -c "STARTDIR=\"$PWD\" exec /bin/bash --login"
This after following Mark's suggestion that this conditional

   if [ -n "$STARTDIR" ]; then
        cd "$STARTDIR"
   fi

be added to one's .bashrc file. The next step will be testing the same
line, including in it the ostensibly cosmetic customization string from
my original rxvt.bat. Namely '-geometry 80x25  -font "Bitstream Vera
Sans Mono-14" '

If that works, then all I should need to add is the conventional @echo
off opener and I'm good to go.

Thanks to Andy for pointing me in the right direction. And if they're
still on the list, thanks also to Mark & Gary.

Cheers.

SJ Wright



--
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]