public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Calling a program without bash login
  2003-01-13  3:30 Calling a program without bash login Travis Whitton
@ 2003-01-13  3:30 ` Randall R Schulz
  2003-01-13  3:30 ` Igor Pechtchanski
  1 sibling, 0 replies; 3+ messages in thread
From: Randall R Schulz @ 2003-01-13  3:30 UTC (permalink / raw)
  To: cygwin

Travis,

You're not giving us much to go on, but here's a better attempt:

C:\cygwin\bin\bash -c "exec /usr/local/bin/ruby /home/travis/myprog.rb"

However, I don't see why you're involving BASH or any shell at all. If the 
Ruby interpreter is invoked from a context in which there is no 
character-stream standard input and output, a console window will be 
created automatically.

You'll only need the BASH if you want the initial point of entry to be a 
shell script. Since as shown you want to invoke the Ruby interpreter 
directly, the shell offers little. One reason you might want to do this is 
if you required environment setup performed within the shell initialization 
processing.

You can create a Windows shortcut or a batch file that will launch Ruby 
with the appropriate script / program name argument. If you use the 
shortcut, you can also establish the window size and position, the font 
used, the colors displayed, etc. I'm not fond of batch scripts, so I don't 
know if similar flexibilty is available that way.

The shortcut approach I favor will allow an arbitrary command invocation, 
so you can use it with or without an intervening shell invocation.

The only thing you'll need to do, at a minimum, is make sure that the 
Cygwin bin directory is in the PATH so that Windows can find and load the 
Cygwin1.dll, the common prerequisite of all Cygwin programs.

Randall Schulz


At 11:40 2003-01-10, Travis Whitton wrote:
>Hello,
>
>I have written a rather extensive program using the cygwin build of
>ruby. Ruby is installed in cygwin inside of /usr/local/bin. I'm trying
>to find a way to create a script to invoke my program without it's users
>having to go into a cygwin bash shell and run it. Ideally, it would be
>something as simple as:
>
>C:\cygwin\bin\bash /usr/local/bin/ruby /home/travis/myprog.rb
>
>but obviously that doesn't work. So, can anybody clue me in as to how to
>accomplish this seemingly simple task? I sure would appreciate it!
>
>Thanks in advance,
>Travis Whitton <whitton@atlantic.net>

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

* Re: Calling a program without bash login
  2003-01-13  3:30 Calling a program without bash login Travis Whitton
  2003-01-13  3:30 ` Randall R Schulz
@ 2003-01-13  3:30 ` Igor Pechtchanski
  1 sibling, 0 replies; 3+ messages in thread
From: Igor Pechtchanski @ 2003-01-13  3:30 UTC (permalink / raw)
  To: Travis Whitton; +Cc: cygwin

On Fri, 10 Jan 2003, Travis Whitton wrote:

> Hello,
> I have written a rather extensive program using the cygwin build of
> ruby. Ruby is installed in cygwin inside of /usr/local/bin. I'm trying
> to find a way to create a script to invoke my program without it's users
> having to go into a cygwin bash shell and run it. Ideally, it would be
> something as simple as:
>
> C:\cygwin\bin\bash /usr/local/bin/ruby /home/travis/myprog.rb
>
> but obviously that doesn't work. So, can anybody clue me in as to how to
> accomplish this seemingly simple task? I sure would appreciate it!
>
> Thanks in advance,
> Travis Whitton <whitton@atlantic.net>

Travis,

'C:\cygwin\usr\local\bin\ruby /home/travis/myprog.rb' should suffice, but
if you really want to fully reconstruct the environment of a bash shell, try
'C:\cygwin\bin\bash --login -c "exec /usr/local/bin/ruby /home/travis/myprog.rb"'
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune

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

* Calling a program without bash login
@ 2003-01-13  3:30 Travis Whitton
  2003-01-13  3:30 ` Randall R Schulz
  2003-01-13  3:30 ` Igor Pechtchanski
  0 siblings, 2 replies; 3+ messages in thread
From: Travis Whitton @ 2003-01-13  3:30 UTC (permalink / raw)
  To: cygwin

Hello,
I have written a rather extensive program using the cygwin build of
ruby. Ruby is installed in cygwin inside of /usr/local/bin. I'm trying
to find a way to create a script to invoke my program without it's users
having to go into a cygwin bash shell and run it. Ideally, it would be
something as simple as:

C:\cygwin\bin\bash /usr/local/bin/ruby /home/travis/myprog.rb

but obviously that doesn't work. So, can anybody clue me in as to how to
accomplish this seemingly simple task? I sure would appreciate it!

Thanks in advance,
Travis Whitton <whitton@atlantic.net>

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

end of thread, other threads:[~2003-01-10 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13  3:30 Calling a program without bash login Travis Whitton
2003-01-13  3:30 ` Randall R Schulz
2003-01-13  3:30 ` Igor Pechtchanski

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