delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/03/01/01:34:44

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <01a001c2dfbc$68604320$0b01a8c0@w2k30g>
From: "David Christensen" <dpchrist AT holgerdanske DOT com>
To: <tdager AT secureworks DOT com>
Cc: <cygwin AT cygwin DOT com>
References: <1720D5C9CF7AD411B30700010226ECC9073763F8 AT atlexchange DOT internal DOT secureworks DOT net>
Subject: Re: how to run a process from DOS within a cygwin .bat file
Date: Fri, 28 Feb 2003 22:22:21 -0800
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

Tom Dager wrote:
> does someone knows how to launch a cygwin shell and further commands
> from DOS, e.g with a help of a .bat file.
> I had a look of cygwin.bat file but I do not know the right syntax to
> give the command to the bash shell

Some thoughts:

1.  Bash can be started either as a login shell or a non-login shell.

2.  Bash executes a larger or smaller set of scripts based upon the
    above.  These scripts need to be written in the Bash shell-scripting
    language.

3.  The choice of scripts is affected by environment variables (notably
    HOME) and/or by command-line arguments.

4.  There is a command line option "-c" that might be just what you're
    looking for:

      -c string If  the  -c option is present, then commands are
                read from string.  If there are arguments  after
                the  string, they are assigned to the positional
                parameters, starting with $0.

If you need more than a one-liner, it should be possible to write
(generate?) a Bash shell script and fix things so that Bash runs that
shell script when it starts (see the --noprofile
and --init-file/--rcfile command-line options).


> If the "manual" was a cohesive, comprehensive document ...

I have the following hypotheses about open-source software and
documentation:

1.  Writing code provides frequent mental stimulus and nearly immediate
    feedback (edit-compile-test-reward/punishment).  It's habit forming.
    The "pull of the summit" is very strong.

2.  Good programmers are rarely good technical writers;  I think its
    part aptitude and part choice/ practice.

3.  Writing code is sexy.  Writing good code makes you popular (even
    famous).  This attacts people towards the skill.

4.  Writing technical documentation is not sexy, and is viewed as an
    inferior role.  This drives people away from the skill.


In the technical book writing/ selling industry, there is positive
reinforcement for good technical writing.  I suggest that you buy the
following book.  I did, learned Bash from it, and find it to be an
invaluable reference.  Plus, I can curl up on the couch with it :-)

[1] Cameron Newham & Bill Rosenblatt, 1998, "Learning the Bash Shell",
    2 ed., O'Reilly & Associates, ISBN 1-56592-347-2.


> sick of seeing the RTFM response.

Agreed.  Good for you for having a measured response.  :-)


As for the RTFM'ers -- it is better to help people, than to attack or
bully them.  "Do unto others...".


HTH,

David


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019