diff --git a/src/tools/cat b/src/tools/cat index f91d408c..97b366e9 100755 --- a/src/tools/cat +++ b/src/tools/cat @@ -2,11 +2,16 @@ files=$1 -if [ -e $files ] -then - cat /dev/null > $2 - for file in $files - do +# Make target file empty +cat /dev/null > $2 + +# Attach each file from the specified mask to the target file +for file in $files +do + # Process a file only if it exists + if [ -e $file ] + then + # Append content of the current file to the target file cat $file >> $2 - done -fi \ No newline at end of file + fi +done \ No newline at end of file