delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/08/21/20:19:39

From: rhowarth AT sgb DOT co DOT uk (Howarth, Richard)
Subject: RE: B18: "sed ** >> a_file", paging error in kernel32.dll in wind
ow 95 Korean Version
21 Aug 1998 20:19:39 -0700 :
Message-ID: <71FAE3A39911D211A16800A0C9B39DFD027B3A.cygnus.gnu-win32@sgbntis.sgb.co.uk>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com


> -----Original Message-----
> From: michael DOT mauch AT gmx DOT de [mailto:michael DOT mauch AT gmx DOT de]
> Sent: 19 August 1998 07:47
> To: "Sung Hoon, Kim (±è¼ºÈÆ)"
> Cc: gnu-win32 AT cygnus DOT com
> Subject: Re: B18: "sed ** >> a_file", paging error in kernel32.dll in
> window 95 Korean Version
> 
> 
> Hi Kim,
> 
> > bash> touch a_file
> > bash> for file in $(ls file?); do
> > > sed -n '1,/Copyright/p' file? >> a_file
> > >done
> > 
> > But this makes errors, saying "bash caused paging error in 
> kernel32.dll."
> > What wrong with this?
> 
> Of course it shouldn't cause a paging error, but try the commands:
> 
> for file in file?; do sed -n '1,/Copyright/p' file? >> a_file; done

Shouldn't the sed part of the command be referencing the environment
variable, i.e.
	for file in file?; do sed -n '1,/Copyright/p' $file >> a_file;
done

otherwise the shell will simply expand the second "file?" again and the
output file will contain n copies of the extraction from the first file
(where n is the number of files which match the "file?" pattern). As you
say, it still shouldn't cause a paging error.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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