[Discuss] data recovery using Linux
Alan W. Irwin
irwin at beluga.phys.uvic.ca
Sat Sep 1 12:01:41 PDT 2007
On 2007-09-01 11:31-0700 R. Langkamer wrote:
>
> Remember those 60 pieces I cat'd together? Well somehow I removed the
> partition I used to temporarily store the one big file made from them. Now, I
> still have the 60 pieces, but I'm hoping there is a way to write a small
> quick shell script to do the work for me, I just don't know how.
> I am using bash in Ubuntu 6.10 and all the files are named like
> file-name.001. Seeing as there is only 60 to work with and the first one is
> named like file-name.img, I was thinking I could use a loop in the shell
> script to cat each file in numerical order and append it to the end of the
> .img file. I've googled, but I haven't found anything that fits. Any ideas?
>
> Thanks in advance!
I suggest something like
cat file-name.img file-name.??[0-9] > concatanated.file
I used .??[0-9] rather than .??? to exclude the .img case (since that
belongs first and you don't want to repeat it), and I believe the .??[0-9]
glob should give you the cat order you want.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
More information about the Discuss
mailing list