Grep and mv

From: WCB (wbarwell_at_Mungggedd.mylinuxisp.com)
Date: 07/12/05


Date: Tue, 12 Jul 2005 14:31:39 -0500

I have a whole bunch of files.
Using csplit I have managed to cut up a bunch
of files into more useful smaller files, now named
xx01 - xxN.

Using grep -m 1 HEADER* XX01 > filename, I can get
a certain line, such as HEADER 6-15-04 which I can copy to filename.

I have been trying to use mv XX01 to use the filename
contents as a name to mv that file to, but I don't seem
to be able to find the way to do that.

I am trying to set up a batch program to grep -m 1 * . filename,
mv * contents of filename to rename all all these xx* files
to the extracted HEADER+date name.

Being no expert at Bash, I am stuck at getting mv to use
the contents of filename as the file's new name.

What do I need to know?
many thanks.

-- 
When I shake my killfile I can hear them buzzing.


Relevant Pages

  • Re: Grep and mv
    ... > I have a whole bunch of files. ... > Using csplit I have managed to cut up a bunch ... Why do use XX01 if the file is xx01? ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • Re: Grep and mv
    ... > Using csplit I have managed to cut up a bunch ... > I have been trying to use mv XX01 to use the filename ... i had a small testing of test files ...
    (comp.unix.shell)
  • Re: Grep and mv
    ... >> I have a whole bunch of files. ... I can save the header to filename and read it using cat ... I am using bash. ... and ignore all other occurances of that string. ...
    (comp.unix.shell)
  • Re: Grep and mv
    ... >I have a whole bunch of files. ... >the contents of filename as the file's new name. ... you need to know *not* to use wildcards in an un-quoted pattern to grep. ... you need to know how to extract the fieldyou want from the line ...
    (comp.unix.shell)
  • OT: MS Word properties manipulation
    ... This is probably more of an MS Word question than .net, ... We have a bunch of forms in MS word format. ... The catch is that every document has a footer that will also list ... whenever the filename is changed? ...
    (microsoft.public.dotnet.framework.aspnet)