Hi,
I have a file like this
cpsSystemNotifyTrap='2010/12/14 11:05:31 CST' Manufacturer=IBM ReportingMTMS=n/a ProbNm=26 LparName=n/a FailingEnclosureMTMS=7946-IQL*99G4874 SRC=B3031107 EventText=Problem reported by customer. CallHome=true Calendar
I want to have a output like this
cpsSystemNotifyTrap='2010/12/14 11:05:31 CST'
Manufacturer=IBM
ReportingMTMS=n/a
ProbNm=26
LparName=n/a
FailingEnclosureMTMS=7946-IQL*99G4874
SRC=B3031107 EventText=Problem reported by customer.
CallHome=true Calendar
Any code how to do it with awk or sed. or any other alternative?
Regards,
Dinesh
---------- Post updated at 05:39 PM ---------- Previous update was at 05:08 PM ----------
I copied one of the solution given in this forum but does not seems to work
#!/usr/bin/sh
set -x
while IFS='&' read -a L
do
for i in ${!L[@]}; do
eval "${L[$i]}"
done
for V in cpsSystemNotifyTrap Manufacturer ReportingMTMS ProbNm LparName FailingEnclosureMTMS SRC EventText CallHome
do
echo -en "$V=${!V}\t"
done
echo
done < /opt/Tivoli/custom/bin/trap.txt