Following doesn’t work.
I need to add a , and an input param at the end of the script. Please help
#!/bin/ksh
data_log="/usr/data/data_log.dbg"
err_file="/usr/data/data_log.err"
if [ $# -eq 1 ]; then
inParam=$1
fi
processInfo ${inParam} > ${data_log}
#Append ,inParam to each line in log for further processing
for logger in `cat ${data_log}`
{
echo ${logger} | sed s/$/,${inParam}/ >> ${err_file}
}
rm -rf ${data_log}
Replace the
for logger inloop where you’re reading the file with this:…which I think can be written like this (no shell to test with at the moment) to avoid a UUOC…