delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/11/20/01:37:45

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <47428046.9010208@gmail.com>
Date: Tue, 20 Nov 2007 14:35:50 +0800
From: Carlo Florendo <subscribermail AT gmail DOT com>
User-Agent: Thunderbird 1.5.0.13 (Windows/20070809)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: cygwin.bat
References: <13839178 DOT post AT talk DOT nabble DOT com>
In-Reply-To: <13839178.post@talk.nabble.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

123cu wrote:
> First, I am a newbee to Cygwin so please excuse my lack of knowledge.
> 
> I have a text file (aaa.txt) which contains a simple grep command. When I
> start Cygwin.bat, I want this file to be started (executed) as part of
> invoking the cygwin.bat file. I don't know how to do it. Any help will be
> appreciated.
> 
> cygwin.bat file
> @echo on
> 
> C:
> chdir C:\cygwin\bin
> set HOME=\cygwin
> bash --login -i

I could give you two ways to do that:

1) You simply have to edit /etc/bash.bashrc then add the line that executes 
aaa.txt.  For example, if, as you say, your file aaa.txt is in "c:\temp 
dir" and contains a *simple* grep command, then the line on the 
/etc/bash.bashrc file would look like this:

`cat /cygdrive/c/temp\ dir/aaa.txt`

Note the backticks at the start and end of the line and note that the 
directory appears as:

"temp\ dir"

and not

"temp dir"



2) You could actually put the entire grep command on /etc/bash.bashrc if 
you wish.


Thank you very much!

Best Regards,

Carlo

-- 
Carlo Florendo
Music Research and Development Division
Astra Philippines Inc.
UP-Ayala Technopark, UP Campus Diliman
1101 Quezon City, Philippines
http://www.astra.ph

--
The Astra Group of Companies
5-3-11 Sekido, Tama City
Tokyo 206-0011, Japan
http://www.astra.co.jp

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

- Raw text -


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