delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/02/21/16:05:00

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4B81999C.6000800@charter.net>
References: <4B81999C DOT 6000800 AT charter DOT net>
Date: Sun, 21 Feb 2010 21:04:49 +0000
Message-ID: <416096c61002211304k3ff8ee20r5728cb72f3e38a4@mail.gmail.com>
Subject: Re: Batch file code to launch rxvt pointed elsewhere than $HOME -- what's wrong with my code?
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019