public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* 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-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-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
  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  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
* 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

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 11:33 cygwin.bat suggestions Polley Christopher W
  -- strict thread matches above, loose matches on Subject: below --
2002-07-14  4:24 Vince Hoffman
2002-07-11 11:26 Polley Christopher W
2002-07-11 11:05 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-10  7:48 Robinow, David
2002-07-10  7:40 Jon LaBadie
2002-07-11 13:07 ` Chris Game
2002-08-21 12:39 ` Soren A
2002-08-21 17:59   ` Soren A

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