public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygwin.bat suggestions
@ 2002-07-10  7:40 Jon LaBadie
  2002-07-11 13:07 ` Chris Game
  2002-08-21 12:39 ` Soren A
  0 siblings, 2 replies; 15+ messages in thread
From: Jon LaBadie @ 2002-07-10  7:40 UTC (permalink / raw)
  To: cygwin

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?

-- 
Jon H. LaBadie                  jcyg@jgcomp.com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: cygwin.bat suggestions
  2002-07-10  7:40 cygwin.bat suggestions Jon LaBadie
@ 2002-07-11 13:07 ` Chris Game
  2002-08-21 12:39 ` Soren A
  1 sibling, 0 replies; 15+ messages in thread
From: Chris Game @ 2002-07-11 13:07 UTC (permalink / raw)
  To: cygwin

In an earlier post, Jon LaBadie said...

> Any suggestion for picking up the shell preference of the user invoking
> the cygwin.bat file?
 
Put the .bat files in %USERPROFILE%\somethingorother\.. and have 
different .bat files for each user?

C.



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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: cygwin.bat suggestions
  2002-07-10  7:40 cygwin.bat suggestions Jon LaBadie
  2002-07-11 13:07 ` Chris Game
@ 2002-08-21 12:39 ` Soren A
  2002-08-21 17:59   ` Soren A
  1 sibling, 1 reply; 15+ messages in thread
From: Soren A @ 2002-08-21 12:39 UTC (permalink / raw)
  To: cygwin

Jon LaBadie <jcyg@jgcomp.com> wrote around 10 Jul 2002
news:20020710134906.GA8942@butch.jgcomp.com about %s: 

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

Yeah, I know. More `General Meanness' at work ;-)
{snip}
> 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?

Not specifically. I only use bash at present. I am just going to make my
Cygwin.bat available for people to look at for the general odd chance
they might see something that helps them. 

It will be at this url for the time being (I am not promising past a
time frame of the next several weeks, that is; I reserve the right to
reorganize my site): 

  http://home.att.net/~perlspinr/build_platforms/cygwin/cygwin_bat.html

Right now what's there is completely bare of expansive explanation; it's
just code. My .bat file for Cygwin does some very unusual things because
I am using Win98, not NT, and because I have (in the past) been a
multi-booter between Win98 and NT and wanted the same setup .bat file to
serve both. 

I will mention one thing concerning user preferences and home dirs:
you've been told to have Cygwin use the home dirs under %USERPROFILE%\
and that's fine, it's a natural idea; under NT-like Windozen the shell
automatically contains, by default, an env var that points to the user's
%USERPROFILE%. But I feel there's a compelling reason to resist this
first suggestion and instead do something else, and that reason is that
we are dealing with _Windows_. Anybody with a little experience with
Windows knows that the day may come when your entire OS installation has
been hosed (particularly, maybe, if you are a home user and your machine
serves multiple purposes) and you'll be doing a reformat of C: ... and
there go your laboriously-crafted shell init files and ALL the other
data in your ~/ dir(s). Happy day, not. 

I think it's rational and prudent to make a completely separate
directory for Cygwin users' home dirs. I personally don't want my Cygwin
files to live on the same partition (logical drive) with the Windows
system. I'd make a directory like D:\home and then use the Cygwin setup
.bat files and the predefined and admin-defined (in the case of Win9x)
Windows env variables to get to them. See my site above for examples of
what i mean. It's really pretty trivial .bat scripting and involves
setting maybe two new variables only for Win9x in your autoexec.bat. 

  FWIW,
    Soren A



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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: cygwin.bat suggestions
  2002-08-21 12:39 ` Soren A
@ 2002-08-21 17:59   ` Soren A
  0 siblings, 0 replies; 15+ messages in thread
From: Soren A @ 2002-08-21 17:59 UTC (permalink / raw)
  To: cygwin

"I", Soren A <soren_andersen=97jfqw80gc6171pxa8y+qA@public.gmane.org> wrote 
around 21 Aug 2002 news:Xns92718947E197Bsoren1Gmane@80.91.224.249 about %s:

> Not specifically. I only use bash at present. I am just going to make my
> Cygwin.bat available for people to look at for the general odd chance
> they might see something that helps them. 
> 
> It will be at this url for the time being (I am not promising past a
> time frame of the next several weeks, that is; I reserve the right to
> reorganize my site): 
> 
>   http://home.att.net/~perlspinr/build_platforms/cygwin/cygwin_bat.html

Update: different URL, more permanent and navigable (although I am making 
no representation to anyone that I am guaranteeing that any aspect of my 
Web site will be workable in their brower or UserAgent). 

  http://home.att.net/~perlspinr/build_platforms/cygwin/index.html

Bye,
  Soren A



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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: cygwin.bat suggestions
@ 2002-07-14  4:24 Vince Hoffman
  0 siblings, 0 replies; 15+ messages in thread
From: Vince Hoffman @ 2002-07-14  4:24 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'


>>>
>> Not really, I'd answered the question fully :-)
>>
>> If the question was "is there any clipboard functionality in rxvt and if
>so
>> how do I use it" I might have said:
>>
>> selecting text, button 1/left drag, copies to the Windows clipboard
>> button 3/middle (or shift button 1/left) pastes from Windows clipboard
>>
>Thanks Mark....I think

>This interchange sounds like it is right out of:

>http://www.tuxedo.org/~esr/faqs/smart-questions.html

>cgf

It was a fair answer, most (although not all) of the info was in the man
page.
Thanks to all the people who were up to reading my mind though ;)

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

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: cygwin.bat suggestions
  2002-07-12 22:22       ` Jim George
@ 2002-07-13  0:06         ` Christopher Faylor
  0 siblings, 0 replies; 15+ messages in thread
From: Christopher Faylor @ 2002-07-13  0:06 UTC (permalink / raw)
  To: cygwin

On Fri, Jul 12, 2002 at 09:37:28PM +0100, Jim George wrote:
>
>----- Original Message -----
>From: "Mark Himsley" <mark@mdsh.com>
>To: <cygwin@cygwin.com>
>Sent: Friday, July 12, 2002 6:03 PM
>Subject: Re: cygwin.bat suggestions
>
>
>> On Fri, 12 Jul 2002 17:00:22 +0100 Jim.George wrote:
>>
>> >On Thu, 11 Jul 2002, Mark Himsley wrote:
>> >
>> >> On Thu, 11 Jul 2002 11:30:14 +0100 Vince Hoffman wrote:
>> >>
>> >> >I know this is an old thread now, but is there any clipboard
>functionality
>> >> >in rxvt ? (im a very lazy typer and like to copy/paste.)
>> >>
>> >> yes
>> >>
>> >Would you care to expand on this Mark?
>>
>> Not really, I'd answered the question fully :-)
>>
>> If the question was "is there any clipboard functionality in rxvt and if
>so
>> how do I use it" I might have said:
>>
>> selecting text, button 1/left drag, copies to the Windows clipboard
>> button 3/middle (or shift button 1/left) pastes from Windows clipboard
>>
>Thanks Mark....I think

This interchange sounds like it is right out of:

http://www.tuxedo.org/~esr/faqs/smart-questions.html

cgf

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: cygwin.bat suggestions
  2002-07-12 15:17     ` Mark Himsley
@ 2002-07-12 22:22       ` Jim George
  2002-07-13  0:06         ` Christopher Faylor
  0 siblings, 1 reply; 15+ messages in thread
From: Jim George @ 2002-07-12 22:22 UTC (permalink / raw)
  To: Mark Himsley, cygwin


----- Original Message -----
From: "Mark Himsley" <mark@mdsh.com>
To: <cygwin@cygwin.com>
Sent: Friday, July 12, 2002 6:03 PM
Subject: Re: cygwin.bat suggestions


> On Fri, 12 Jul 2002 17:00:22 +0100 Jim.George wrote:
>
> >On Thu, 11 Jul 2002, Mark Himsley wrote:
> >
> >> On Thu, 11 Jul 2002 11:30:14 +0100 Vince Hoffman wrote:
> >>
> >> >I know this is an old thread now, but is there any clipboard
functionality
> >> >in rxvt ? (im a very lazy typer and like to copy/paste.)
> >>
> >> yes
> >>
> >Would you care to expand on this Mark?
>
> Not really, I'd answered the question fully :-)
>
> If the question was "is there any clipboard functionality in rxvt and if
so
> how do I use it" I might have said:
>
> selecting text, button 1/left drag, copies to the Windows clipboard
> button 3/middle (or shift button 1/left) pastes from Windows clipboard
>
> --
> Mark Himsley
> In Acton
>
Thanks Mark....I think

Jim


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: cygwin.bat suggestions
  2002-07-12 10:03   ` Jim.George
@ 2002-07-12 15:17     ` Mark Himsley
  2002-07-12 22:22       ` Jim George
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Himsley @ 2002-07-12 15:17 UTC (permalink / raw)
  To: cygwin

On Fri, 12 Jul 2002 17:00:22 +0100 Jim.George wrote:

>On Thu, 11 Jul 2002, Mark Himsley wrote:
>
>> On Thu, 11 Jul 2002 11:30:14 +0100 Vince Hoffman wrote:
>>
>> >I know this is an old thread now, but is there any clipboard functionality
>> >in rxvt ? (im a very lazy typer and like to copy/paste.)
>>
>> yes
>>
>Would you care to expand on this Mark?

Not really, I'd answered the question fully :-)

If the question was "is there any clipboard functionality in rxvt and if so
how do I use it" I might have said:

selecting text, button 1/left drag, copies to the Windows clipboard
button 3/middle (or shift button 1/left) pastes from Windows clipboard

-- 
Mark Himsley
In Acton

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: cygwin.bat suggestions
  2002-07-11  6:03 ` Mark Himsley
@ 2002-07-12 10:03   ` Jim.George
  2002-07-12 15:17     ` Mark Himsley
  0 siblings, 1 reply; 15+ messages in thread
From: Jim.George @ 2002-07-12 10:03 UTC (permalink / raw)
  To: Mark Himsley; +Cc: cygwin

On Thu, 11 Jul 2002, Mark Himsley wrote:

> On Thu, 11 Jul 2002 11:30:14 +0100 Vince Hoffman wrote:
>
> >I know this is an old thread now, but is there any clipboard functionality
> >in rxvt ? (im a very lazy typer and like to copy/paste.)
>
> yes
>
>
Would you care to expand on this Mark?

Jim



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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: cygwin.bat suggestions
@ 2002-07-11 11:26 Polley Christopher W
  0 siblings, 0 replies; 15+ messages in thread
From: Polley Christopher W @ 2002-07-11 11:26 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'; +Cc: 'Jon LaBadie'



> -----Original Message-----
> From: Jon LaBadie
> 
> On Wed, Jul 10, 2002 at 12:44:19PM -0500, Polley Christopher W wrote:
> > 
> > > From: Jon LaBadie
> > > 
> > > 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}
> > > 
> >
> > 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)
> 
> Chris,
> first tests show it working.  I never considered mixing 
> cygwin calls in a .bat.
> 
> To save me from learning batch file programming, one last 
> thing please.
> 
> The possibility exists that column seven in /etc/passwd is 
> empty (a valid situation).
> In that case the code would be setting SHELL= , i.e. a null 
> value.  I'd like to
> supply a default (probably /bin/bash).  In shell it would be 
> easy, in batch I
> guess it would take an if statement (assuming they exist in 
> batch).  The cumbursome
> shell way would be something like:
> 
> 	if [[ ${SHELL} = "" ]]
> 	then
> 		export SHELL=/bin/bash
> 	fi
> 
> Would something similar be available in batch?  A guess:
> 
> 	if %SHELL% = "" set SHELL=/bin/passwd
> 

This is close, but when doing string comparisons in batch, you need to quote
both sides:

if "%SHELL%" = "" set SHELL=/bin/bash


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: cygwin.bat suggestions
@ 2002-07-11 11:05 Polley Christopher W
  0 siblings, 0 replies; 15+ messages in thread
From: Polley Christopher W @ 2002-07-11 11:05 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: cygwin.bat suggestions
  2002-07-11  5:23 Vince Hoffman
@ 2002-07-11  6:03 ` Mark Himsley
  2002-07-12 10:03   ` Jim.George
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Himsley @ 2002-07-11  6:03 UTC (permalink / raw)
  To: cygwin

On Thu, 11 Jul 2002 11:30:14 +0100 Vince Hoffman wrote:

>I know this is an old thread now, but is there any clipboard functionality
>in rxvt ? (im a very lazy typer and like to copy/paste.)

yes

-- 
Mark Himsley
In Acton

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: cygwin.bat suggestions
@ 2002-07-11  5:23 Vince Hoffman
  2002-07-11  6:03 ` Mark Himsley
  0 siblings, 1 reply; 15+ messages in thread
From: Vince Hoffman @ 2002-07-11  5:23 UTC (permalink / raw)
  To: cygwin

I know this is an old thread now, but is there any clipboard functionality
in rxvt ? (im a very lazy typer and like to copy/paste.)
Vince

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


------------------------------------------------------------
1.This e-mail and its attachments are intended for the above 
named only and may be confidential.  Any opinions expressed 
in this email are those of the individual and not necessarily 
the company. If they have come to you in error please notify 
the sender immediately, and delete this email from your 
system without copying, disseminating or placing any reliance 
upon its contents.
2.Please note that this e-mail has been created in the 
knowledge that Internet e-mail is not a 100% secure 
communications medium.  We advise that you understand and 
observe this lack of security when e-mailing us.
3.Although we have taken steps to ensure that this e-mail and 
attachments are free from any virus, we advise that in 
keeping with good computing practice the recipient should 
ensure they are actually virus free.
------------------------------------------------------------


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: cygwin.bat suggestions
@ 2002-07-10 11:33 Polley Christopher W
  0 siblings, 0 replies; 15+ messages in thread
From: Polley Christopher W @ 2002-07-10 11:33 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: cygwin.bat suggestions
@ 2002-07-10  7:48 Robinow, David
  0 siblings, 0 replies; 15+ messages in thread
From: Robinow, David @ 2002-07-10  7:48 UTC (permalink / raw)
  To: cygwin

> Any suggestion for picking up the shell preference of the 
> user invoking the cygwin.bat file?
   That's the responsibility of the individual user.
Stay out of it.

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-08-21 22:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-10  7:40 cygwin.bat suggestions Jon LaBadie
2002-07-11 13:07 ` Chris Game
2002-08-21 12:39 ` Soren A
2002-08-21 17:59   ` Soren A
2002-07-10  7:48 Robinow, David
2002-07-10 11:33 Polley Christopher W
2002-07-11  5:23 Vince Hoffman
2002-07-11  6:03 ` Mark Himsley
2002-07-12 10:03   ` Jim.George
2002-07-12 15:17     ` Mark Himsley
2002-07-12 22:22       ` Jim George
2002-07-13  0:06         ` Christopher Faylor
2002-07-11 11:05 Polley Christopher W
2002-07-11 11:26 Polley Christopher W
2002-07-14  4:24 Vince Hoffman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).