Shell Scripting for KSH
Hiii,
I have to add a new blank line to a file before each day field. The file looks some what like this. Mon 10 oct 11.30 pm idskafaslkj dsflhsajkdf sdflsa,nf Mon 10 oct 11.55 pm hfdksaje dfgsdfg fdgsd wrljhfk werflflakaj Tue 11 oct 10.05 am fsadfsf sdfsadf asdfsadfa Wed 12 oct 11.55pm dfasfasdf sda fsdaf sdf I have written a shell script but can add space only for a single day ex monday. The command is as follows sed -e '/Mon/{x;p;x;}' error.log>e.q How do I add the othwer days? Help me please Thanks Sagar |
Code:
awk '/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)/ { print "";}1' "file" |
All times are GMT -5. The time now is 02:59 PM. |