Refactor loop to use for-do instead of while-read.

This for loop around find removes the need for the read statement.
The read statement isn't portable to solaris, because Read has no -r option
in /bin/sh on solaris. This should resolve Issue #45.
This commit is contained in:
Spencer Krum 2013-07-13 13:41:14 -07:00 committed by Spencer Krum
parent fe537c0f4f
commit 3d60c9ef61

View file

@ -112,9 +112,14 @@ else
fi
# find all the files in the fragments directory, sort them numerically and concat to fragments.concat in the working dir
find fragments/ -type f -follow | LANG=C sort ${SORTARG} | while read -r fragfile; do
cat "$fragfile" >> "fragments.concat"
IFS_BACKUP=$IFS
IFS='
'
for fragfile in `find fragments/ -type f -follow | LANG=C sort ${SORTARG}`
do
cat $fragfile >> concat.fragment
done
IFS=$IFS_BACKUP
if [ x${TEST} = "x" ]; then
# This is a real run, copy the file to outfile