Quote:
Originally posted by bollin99
So is there a mechanism to put the file names and the exec commands in a loop/sequence and execute the next set of command ?
eg: there are files 1-10 then
read the file names 1-10 from a file then
define the exec for 1-10 and then concatenate ?
|
Hi 'Bollin99'.
Obviously you didn't spot the deliberate mistake in my previous post. The method I gave you would require the file with the most rows to be assigned to the last file descriptor read in the 'while' logic test (because only the result of the final test is used).
I've attached a script that gets round this and which takes between 1 and 7 files as parameters.
If you need to work with greater numbers of files, you would just call the script within a loop. Something like...
------------------------------
touch tempFile
while read fileName
do
fpaste tempFile ${fileName} > newTempFile &&
mv newTempFile tempFile
done < fileListFile
------------------------------
This kind of defeats the object of dynamically allocating the file descriptors in the 'fpaste' script but I couldn't think of an easy way to get round the limitation of 9 file descriptors (of which 2 are used for stderr and stdout).
Damian