This is the mail archive of the cygwin@cygwin.com 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: cygwin.bat suggestions


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


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