{
if ( $1 == "*LIST*" )
{
printf "set sendList = %s.send\n", $2;
printf "set numFiles = %s\n", $3;
print "if ( $numFiles ) then";
print " set tmpList = /tmp/asList$$.send";
print " set linecounter = 1";
print " set fullline = `sed -n $linecounter'p' $sendList`";
print " set useLine = 0";
print " while ( \"$fullline\" != \"\" )";
print " if ( $useLine ) then";
print " echo \"$fullline\" >> $tmpList";
print " else";
print " set fname = `echo \"$fullline\" | awk '{printf $1}'`";
print " if ( \"$fname\" != \"\" ) then";
print " set fargs = `echo \"$fullline\" | sed -e \"s?$fname??\"`";
printf " echo \"%s $fname FULL $fargs", $2;
for ( i = 4; i <= NF; ++i )
printf " %s", $i;
printf "\"\n";
print " endif";
print " endif";
print " if ( $linecounter == $numFiles ) set useLine = 1";
print " @ linecounter = $linecounter + 1";
print " set fullline = `sed -n $linecounter'p' $sendList`";
print " end";
print " mv -f $tmpList $sendList";
print "else";
print " echo \"DON'T KNOW HOW MANY FILES TO SEND\!\!\!\"";
print "endif";
print "if ( -z $sendList ) then";
print " rm $sendList";
print "else";
printf " echo \"%s\" >> $nextAuto\n", $0;
print "endif";
}
else
{
printf "echo \"%s\"\n", $0;
}
}
syntax highlighted by Code2HTML, v. 0.9.1