delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/27/06:25:18

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: <3500515B75D9D311948800508BA37955014BDCBA@EX-LONDON>
From: Vince Hoffman <Vince DOT Hoffman AT uk DOT circle DOT com>
To: "'Amer Baig'" <amer DOT baig AT ufonegsm DOT net>, cygwin AT cygwin DOT com
Subject: RE: Help on Scripts
Date: Fri, 27 Jun 2003 11:25:00 +0100
MIME-Version: 1.0

Not realy thecorrect list, you need a shell scripting list or newsgroup like
comp.unix.shell
however in bash something like 

-----------cut here--------------------------
#!/bin/bash

#enter date here (using your example)
DATE=20030117
#set number here
NUMBER=5100025

for file in PPD.$DATE.* 
	do
		echo $file
		grep -n $NUMBER $file
		echo "-----------------------"
	done
-----------------------cut here-------------
should do the job.

(i'm only a dabbler in shell scripting though so test throughly :) 

> -----Original Message-----
> From: Amer Baig [mailto:amer DOT baig AT ufonegsm DOT net]
> Sent: 27 June 2003 11:04
> To: cygwin AT cygwin DOT com
> Subject: Help on Scripts
> 
> 
> This is first time I am using this mailing list, so please 
> direct me to
> right list if I am putting it on wrong place. I am IT professional
> working in a telecom sector.
> 
> I have installed Cygwin on Windows Xp. I have file in a folder with
> names like PPD.20030116.0298, PPD.20030116.0299 , 
> PPD.20030117.0298 etc.
> Each file contains calls against a Mobile Number. I can grep those
> record from each file. The file name depicts the date. I am I am asked
> to grep call details of Mobile number 5100025 for 16 Jan 
> 2003. I need to
> find files for such dates then need to open each file and have to grep
> for 5100025. I need to write scripts which solve the purpose. Can
> anybody help me?
> 
> Regards,
> 
> MAB
> 
> --
> 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/

- Raw text -


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