pmcmicha
Technical User
- May 25, 2000
- 353
I have a ksh script setup to pass variables to an awk sub-routine, but I am having problems with the sub-routine trying to print on the same line.
Sub-routine:
OUTPUT() {
export THEYEAR=${YR1}
export THECOUNT=$1
echo $2|/usr/bin/nawk -F"_" '{for (i = ENVIRON["THECOUNT"]; i <= NF; i++) {N = ENVIRON["THEYEAR"] "_" $i; {print "Now creating directory: " ENVIRON["THEYEAR"] "_" $i "....."}; system("/usr/bin/mkdir -m 777 " N); {print "Done."}}}'
}
I would like to print "Now creating the directory: alksfj....." and then have "Done." appear after the ....., but I cannot get this to happen. I tried \c like you would normally in ksh, but this didn't work and I can't seem to find an escape character for this in the books I have about awk.
Thanks in advance.
Sub-routine:
OUTPUT() {
export THEYEAR=${YR1}
export THECOUNT=$1
echo $2|/usr/bin/nawk -F"_" '{for (i = ENVIRON["THECOUNT"]; i <= NF; i++) {N = ENVIRON["THEYEAR"] "_" $i; {print "Now creating directory: " ENVIRON["THEYEAR"] "_" $i "....."}; system("/usr/bin/mkdir -m 777 " N); {print "Done."}}}'
}
I would like to print "Now creating the directory: alksfj....." and then have "Done." appear after the ....., but I cannot get this to happen. I tried \c like you would normally in ksh, but this didn't work and I can't seem to find an escape character for this in the books I have about awk.
Thanks in advance.