Hello Friends,
Hope you are doing well.
I am writing a shell script to find out the log file which are not updated in last 1 hours. I've almost completed the script but need your help in formatting its outputs.
Currently, the output of the script is like this(as a flat row):
-rw-rw-r-- 1 tibco tibco Jun 18 10:01 /opt/tibco/tra/domain/ICCIR2Test11/logs/ApplicationManagement.log
In this the domain name is ICCIR2Test11, log file would be *.log and time would be its modification time as usual.
I need to convert the output as below:
Domain Name Log File Time last updated
ICCIR2Test11 ApplicationManagement.log Jun 18 10:01
I tried the below codes just for a test,
echo -rw-rw-r-- 1 tibco tibco Jun 18 10:01 /opt/tibco/tra/domain/ICCIR2Test11/logs/ApplicationManagement.log | cut -d"/" -f6; echo -rw-rw-r-- 1 tibco tibco Jun 18 10:01 /opt/tibco/tra/domain/ICCIR2Test11/logs/ApplicationManagement.log | cut -d" " -f5,6,7
and the output is
ICCIR2Test11
Jun 18 10:01
Can you please let me know if it is possible to convert it into the format described above?
Any help would be highly appereciated.
Thanks,
Chandan