UPDATE: short script to cat filename

From: Mike's List (mikelist@sky.net)
Date: Wed Jan 21 2004 - 11:03:17 EST


I apologized for any confusion of my post due to the late hours...
but what I want to accomplish is as follows: (cat is the ONLY option,
no cp/mv/ls/etc.)

#!/bin/sh
cat /somedir/file00000.txt > /mydir/file00000.txt
...
cat /somedir/file25000.txt > /mydir/file25000.txt

Yank/copy and search/replace 25k times within vi for a script is not an
option and not too productive. I have the below in a script, but it's
not working. I do not want to >> to one large file.

#!/bin/sh
# Somehow variable i needs to equal to 00000 to 25000 as the filenames
# are file00000.txt through file25000.txt, note, $i needs to increment
# by 00000 to 00001 to 00002 and so on, not 1, 2, 3...25000.
for i in *
do
cat /somedir/file$i.txt > /mydir/file$i.txt
done

- Mike

---------- previous message ----------

I have over 25000 small text files that I can only displays on screen
and cannot mv or cp. Could someone forward me a short script to do the
following:

cat file00000.txt - file25000.txt > file00000.txt - file25000.txt

I'm thinking of the below, but I'm not a script expert.

#!/bin/ksh
for i = 0-25000
do
cat file$i.txt > file$i.txt
end

Basically, cat 25000 small files and piping it into the same filename.
Late project, hopefully someone is reading the list this late. Thanks.

- Mike

[ In addition to www.sunfreeware.com more packages at ftp.patriots.net ]
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:27:52 EDT