* setting windows environment variables
@ 2004-07-20 20:39 Jason Joines
2004-07-20 21:48 ` Larry Hall
2004-07-22 16:33 ` Jaeho Shin
0 siblings, 2 replies; 8+ messages in thread
From: Jason Joines @ 2004-07-20 20:39 UTC (permalink / raw)
To: cygwin
I have a Cygwin BASH script which takes user input, uses ldapsearch,
etc., to set a bunch of environment variables. I can then use these
from bash with no problem. I would also like to make these environment
variables available to the windows command interpreter.
Is there anyway to do this?
Also, is there a BASH equivalent of the windows cmd start command that
lets you start many processes without having to wait on each to finish?
Thanks,
Jason Joines
===============================
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting windows environment variables
2004-07-20 20:39 setting windows environment variables Jason Joines
@ 2004-07-20 21:48 ` Larry Hall
2004-07-21 15:08 ` Jason Joines
2004-07-22 16:33 ` Jaeho Shin
1 sibling, 1 reply; 8+ messages in thread
From: Larry Hall @ 2004-07-20 21:48 UTC (permalink / raw)
To: Jason Joines, cygwin
At 04:18 PM 7/20/2004, you wrote:
> I have a Cygwin BASH script which takes user input, uses ldapsearch, etc., to set a bunch of environment variables. I can then use these from bash with no problem. I would also like to make these environment variables available to the windows command interpreter.
> Is there anyway to do this?
Only if the windows command interpreter is a child of the bash process you
run from. Otherwise, your best bet is to export the variables as some
batch file and run that in the windows command interpreter.
> Also, is there a BASH equivalent of the windows cmd start command that lets you start many processes without having to wait on each to finish?
How about 'cygstart'?
--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
838 Washington Street (508) 893-9889 - FAX
Holliston, MA 01746
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting windows environment variables
2004-07-20 21:48 ` Larry Hall
@ 2004-07-21 15:08 ` Jason Joines
0 siblings, 0 replies; 8+ messages in thread
From: Jason Joines @ 2004-07-21 15:08 UTC (permalink / raw)
To: cygwin
Just found cygstart was in cygutils and used it. The --hide option was
just what I needed.
Thanks,
Jason Joines
=================================
Larry Hall wrote:
> At 04:18 PM 7/20/2004, you wrote:
>
>> I have a Cygwin BASH script which takes user input, uses ldapsearch, etc., to set a bunch of environment variables. I can then use these from bash with no problem. I would also like to make these environment variables available to the windows command interpreter.
>> Is there anyway to do this?
>
>
>
> Only if the windows command interpreter is a child of the bash process you
> run from. Otherwise, your best bet is to export the variables as some
> batch file and run that in the windows command interpreter.
>
>
>
>> Also, is there a BASH equivalent of the windows cmd start command that lets you start many processes without having to wait on each to finish?
>
>
>
> How about 'cygstart'?
>
>
> --
> Larry Hall http://www.rfk.com
> RFK Partners, Inc. (508) 893-9779 - RFK Office
> 838 Washington Street (508) 893-9889 - FAX
> Holliston, MA 01746
>
>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting windows environment variables
2004-07-20 20:39 setting windows environment variables Jason Joines
2004-07-20 21:48 ` Larry Hall
@ 2004-07-22 16:33 ` Jaeho Shin
1 sibling, 0 replies; 8+ messages in thread
From: Jaeho Shin @ 2004-07-22 16:33 UTC (permalink / raw)
To: cygwin
[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]
On Tue, 2004-07-20 15:18:34 -0500, Jason Joines wrote:
> I have a Cygwin BASH script which takes user input, uses ldapsearch,
> etc., to set a bunch of environment variables. I can then use these
> from bash with no problem. I would also like to make these environment
> variables available to the windows command interpreter.
> Is there anyway to do this?
Try setx:
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/setx-o.asp
You can change Windows environment variables from the command line, so
that you can call setx and change them from bash scripts. It works
excellent for me to share a single ssh-agent Windows-wide. :)
You can use it only on NT/2000/XP, perhaps.
I'm not sure what's available on Windows 9X/ME.
> Also, is there a BASH equivalent of the windows cmd start command
> that lets you start many processes without having to wait on each to finish?
``cygstart'' should be what you are looking for.
--
신재호 | Jaeho Shin <netj@ropas.snu.ac.kr> | http://netj.org/
Research On Program Analysis System, Seoul National University
[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: setting windows environment variables
@ 2004-07-21 15:36 Morche Matthias
0 siblings, 0 replies; 8+ messages in thread
From: Morche Matthias @ 2004-07-21 15:36 UTC (permalink / raw)
To: cygwin
so, maybe
nohup smbmount //whatever /whereever > /dev/null 2>&1 &
should do, still in an portable way...
matthias
...
> starting all the mappings without waiting on completion but my BASH
> window wont' go away until they have all completed.
> On Linux, something simple like:
> #!/bin/bash
> smbmount //srv1/share1 ~/share1 &
> smbmount //srv1/share2 ~/share2 &
> smbmount //srv1/share3 ~/share3 &
> smbmount //srv2/share4 ~/share4 &
> exit
...
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting windows environment variables
2004-07-21 14:08 ` Robert Pendell
@ 2004-07-21 14:52 ` Jason Joines
0 siblings, 0 replies; 8+ messages in thread
From: Jason Joines @ 2004-07-21 14:52 UTC (permalink / raw)
To: cygwin
Unfortunately, it won't be used on a real operating system, just
windows. I write BASH scripts for Linux daily and have tried to use the
& in this situation but the behavior doesn't seem to be the same.
We have an odd situation with some user's in one directory with one
username and another with a different username and some in just one or
the other. Long story...
I needed a way to obtain drive mappings from a directory based on user
input on a standalone PC. Being familiar with BASH on Linux I stuck
Cygwin BASH on windows 2000.
The script prompts the user for their username and password, then uses
ldapsearch to get their home directory path, then uses windows "net use"
to map H: to that path and a few other drives. The shares are on a very
unstable active directory/windows 2003 setup. Again, long story... If
I just call the four "net use" commands one at a time waiting for each
to complete before it attempts the next, it will at times take over 5
minutes. Using the & after the "net use" commands does what I want with
starting all the mappings without waiting on completion but my BASH
window wont' go away until they have all completed.
On Linux, something simple like:
#!/bin/bash
smbmount //srv1/share1 ~/share1 &
smbmount //srv1/share2 ~/share2 &
smbmount //srv1/share3 ~/share3 &
smbmount //srv2/share4 ~/share4 &
exit
would work just fine. Any ideas on how to accomplish the same thing here?
Thanks,
Jason Joines
===============================
Robert Pendell wrote:
> And it is compatible for use on *bsd, linux, and unix. So if you are
> writing a script to be used on a real *nix or *bsd system then that
> would be the one to use.
>
> On Wed, 21 Jul 2004 15:00:26 +0200, Morche Matthias wrote:
>
>>...to set environmental variables for windows you can use regtool...
>>But in that case they get persistent...
>>
>>...and the simplest equivalent to start is using & to background the command...
>>
>> matthias
>>
>>
>>
>>
>>>-----Original Message-----
>>>From: cygwin-owner@cygwin.com
>>>[mailto:cygwin-owner@cygwin.com]On Behalf
>>>Of Larry Hall
>>>Sent: Tuesday, July 20, 2004 10:38 PM
>>>To: Jason Joines; cygwin@cygwin.com
>>>Subject: Re: setting windows environment variables
>>>
>>>
>>>At 04:18 PM 7/20/2004, you wrote:
>>>
>>>> I have a Cygwin BASH script which takes user input, uses
>>>
>>>ldapsearch, etc., to set a bunch of environment variables. I
>>>can then use these from bash with no problem. I would also
>>>like to make these environment variables available to the
>>>windows command interpreter.
>>>
>>>> Is there anyway to do this?
>>>
>>>
>>>Only if the windows command interpreter is a child of the
>>>bash process you
>>>run from. Otherwise, your best bet is to export the variables as some
>>>batch file and run that in the windows command interpreter.
>>>
>>>
>>>
>>>> Also, is there a BASH equivalent of the windows cmd
>>>
>>>start command that lets you start many processes without
>>>having to wait on each to finish?
>>>
>>>
>>>How about 'cygstart'?
>>>
>>>
>>>--
>>>Larry Hall http://www.rfk.com
>>>RFK Partners, Inc. (508) 893-9779 - RFK Office
>>>838 Washington Street (508) 893-9889 - FAX
>>>Holliston, MA 01746
>>>
>>>
>>>--
>>>Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>>>Problem reports: http://cygwin.com/problems.html
>>>Documentation: http://cygwin.com/docs.html
>>>FAQ: http://cygwin.com/faq/
>>>
>>>
>>
>>--
>>Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>>Problem reports: http://cygwin.com/problems.html
>>Documentation: http://cygwin.com/docs.html
>>FAQ: http://cygwin.com/faq/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: setting windows environment variables
2004-07-21 13:27 Morche Matthias
@ 2004-07-21 14:08 ` Robert Pendell
2004-07-21 14:52 ` Jason Joines
0 siblings, 1 reply; 8+ messages in thread
From: Robert Pendell @ 2004-07-21 14:08 UTC (permalink / raw)
To: Cygwin eMail List
And it is compatible for use on *bsd, linux, and unix. So if you are
writing a script to be used on a real *nix or *bsd system then that
would be the one to use.
On Wed, 21 Jul 2004 15:00:26 +0200, Morche Matthias wrote:
> ...to set environmental variables for windows you can use regtool...
> But in that case they get persistent...
>
> ...and the simplest equivalent to start is using & to background the command...
>
> matthias
>
>
>
> > -----Original Message-----
> > From: cygwin-owner@cygwin.com
> > [mailto:cygwin-owner@cygwin.com]On Behalf
> > Of Larry Hall
> > Sent: Tuesday, July 20, 2004 10:38 PM
> > To: Jason Joines; cygwin@cygwin.com
> > Subject: Re: setting windows environment variables
> >
> >
> > At 04:18 PM 7/20/2004, you wrote:
> > > I have a Cygwin BASH script which takes user input, uses
> > ldapsearch, etc., to set a bunch of environment variables. I
> > can then use these from bash with no problem. I would also
> > like to make these environment variables available to the
> > windows command interpreter.
> > > Is there anyway to do this?
> >
> >
> > Only if the windows command interpreter is a child of the
> > bash process you
> > run from. Otherwise, your best bet is to export the variables as some
> > batch file and run that in the windows command interpreter.
> >
> >
> > > Also, is there a BASH equivalent of the windows cmd
> > start command that lets you start many processes without
> > having to wait on each to finish?
> >
> >
> > How about 'cygstart'?
> >
> >
> > --
> > Larry Hall http://www.rfk.com
> > RFK Partners, Inc. (508) 893-9779 - RFK Office
> > 838 Washington Street (508) 893-9889 - FAX
> > Holliston, MA 01746
> >
> >
> > --
> > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> > Problem reports: http://cygwin.com/problems.html
> > Documentation: http://cygwin.com/docs.html
> > FAQ: http://cygwin.com/faq/
> >
> >
>
> --
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Problem reports: http://cygwin.com/problems.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
>
>
--
Robert Pendell
shinji257@gmail.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: setting windows environment variables
@ 2004-07-21 13:27 Morche Matthias
2004-07-21 14:08 ` Robert Pendell
0 siblings, 1 reply; 8+ messages in thread
From: Morche Matthias @ 2004-07-21 13:27 UTC (permalink / raw)
To: Cygwin List
...to set environmental variables for windows you can use regtool...
But in that case they get persistent...
...and the simplest equivalent to start is using & to background the command...
matthias
> -----Original Message-----
> From: cygwin-owner@cygwin.com
> [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Larry Hall
> Sent: Tuesday, July 20, 2004 10:38 PM
> To: Jason Joines; cygwin@cygwin.com
> Subject: Re: setting windows environment variables
>
>
> At 04:18 PM 7/20/2004, you wrote:
> > I have a Cygwin BASH script which takes user input, uses
> ldapsearch, etc., to set a bunch of environment variables. I
> can then use these from bash with no problem. I would also
> like to make these environment variables available to the
> windows command interpreter.
> > Is there anyway to do this?
>
>
> Only if the windows command interpreter is a child of the
> bash process you
> run from. Otherwise, your best bet is to export the variables as some
> batch file and run that in the windows command interpreter.
>
>
> > Also, is there a BASH equivalent of the windows cmd
> start command that lets you start many processes without
> having to wait on each to finish?
>
>
> How about 'cygstart'?
>
>
> --
> Larry Hall http://www.rfk.com
> RFK Partners, Inc. (508) 893-9779 - RFK Office
> 838 Washington Street (508) 893-9889 - FAX
> Holliston, MA 01746
>
>
> --
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Problem reports: http://cygwin.com/problems.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
>
>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-07-22 16:08 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-20 20:39 setting windows environment variables Jason Joines
2004-07-20 21:48 ` Larry Hall
2004-07-21 15:08 ` Jason Joines
2004-07-22 16:33 ` Jaeho Shin
2004-07-21 13:27 Morche Matthias
2004-07-21 14:08 ` Robert Pendell
2004-07-21 14:52 ` Jason Joines
2004-07-21 15:36 Morche Matthias
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).