From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32068 invoked by alias); 10 Jul 2002 17:45:32 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 32054 invoked from network); 10 Jul 2002 17:45:28 -0000 Received: from unknown (HELO fdpnmailgw3.mailgws.com) (192.43.65.231) by sources.redhat.com with SMTP; 10 Jul 2002 17:45:28 -0000 X-Server-Uuid: 2d3b7162-db1d-11d3-b8ee-0008c7dfb6f1 Message-ID: <718198F862F1D411B10F0002A50A4DB1059FEA3D@e90wwce3.dx.deere.com> From: "Polley Christopher W" Reply-to: cygwin@cygwin.org To: "'cygwin@cygwin.com'" Subject: RE: cygwin.bat suggestions Date: Wed, 10 Jul 2002 11:33:00 -0000 MIME-Version: 1.0 X-WSS-ID: 1132ADF1245442-01-02 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00844.txt.bz2 > From: Jon LaBadie [mailto:jcyg@jgcomp.com] > On Wed, Jul 10, 2002 at 12:06:09PM +0100, David Starks-Browning wrote: > > On Tuesday 9 Jul 02, Dantin writes: > > > How do I use rxvt in conjuction with the cygwin do > I need a switch for > > > the batch file? If so what would that switch be? Or do I > need to modify the > > > batch file itself? > > > > If you search the email archives you should find numerous > examples of > > how people invoke rxvt. I use a shortcut as follows: > > > > C:\cygwin\bin\rxvt.exe -e bash --login > > I'm looking for sample cygwin.bat files. > I tried a search of the archives, what a mistake, information > overload. > But after scanning several hundred messages, no samples. > > One thing I would like is to have a single cygwin.bat service multiple > users with different shell preferences. Currently I'm forcing ksh > as follows: > > $ cat /cygwin.bat > @echo off > > C: > chdir \cygwin\bin > > set SHELL=/bin/ksh > > rxvt --loginShell -geometry 108x32 -fn 10x20 -sr +ut > > 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} > > Of course, that is shell programming, not windows batch file > programming. > I'm good at the former, not the latter :( > > 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) Warm Regards, 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/