Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Server-Uuid: 2d3b7162-db1d-11d3-b8ee-0008c7dfb6f1 Message-ID: <718198F862F1D411B10F0002A50A4DB1059FEA42@e90wwce3.dx.deere.com> From: "Polley Christopher W" Reply-to: cygwin AT cygwin DOT com To: "'cygwin AT cygwin DOT com'" Subject: RE: cygwin.bat suggestions Date: Thu, 11 Jul 2002 12:07:26 -0500 MIME-Version: 1.0 X-WSS-ID: 113364D9679635-01-02 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit > -----Original Message----- > From: Jon LaBadie > > On Wed, Jul 10, 2002 at 12:44:19PM -0500, Polley Christopher W wrote: > > > > > From: Jon LaBadie > > > > > > I'm looking for sample cygwin.bat files. > ... > > > > > > One thing I would like to do is replace "set SHELL=/bin/ksh" with > > > > > > SHELL=$(grep "^${USER}:" /etc/passwd | cut -d: -f7) > > > : ${SHELL:=/bin/ksh} > > > > ... > > > > > > Any suggestion for picking up the shell preference of the > > > user invoking the cygwin.bat file? > > How about: > > > > ------>8-------- > > @echo off > > > > C: > > chdir \cygwin\bin > > > > rem set SHELL to user's shell (from /etc/passwd) > > bash -c "echo -n 'set SHELL='> temp_setShellEnvVar.bat" > > grep "^%USERNAME%:" /etc/passwd | cut -d: -f7 >> > temp_setShellEnvVar.bat > > call temp_setShellEnvVar.bat > > del temp_setShellEnvVar.bat > > > > rxvt --loginShell -geometry 108x32 -fn 10x20 -sr +ut > > > > ------>8-------- > > > > (window's 'echo' is unable to write to a line without a > crlf at the end, and > > AFAIK, there's no backtick equivalent in batch programming) > > > > Ugly, but looks like it should work. I agree - but setting env variables to the results of a program's output is ugly in batches. A more elegant solution from David Cobb can be found at http://cygwin.com/ml/cygwin/2001-09/msg01354.html This way doesn't work for me, though -- I get prompted for a password, and mine doesn't work (although I can telnet into the machine) Perhaps there have been some changes that have broken this in the last year, or perhaps it only works on 95/98/ME. > Thanks, You're welcome. -Chris -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/