For example, there are some temperature data at those folders in different time.
temps.txt
contains the temperature number. So how can I use bash script to find out the maximum temperature? (the results only show the date,time and number of temperature,e.g. ./2011.10.20/00:00/temps.txt 27C
).
$ ls
2011.10.20 2012.01.20 2012.04.16 2012.07.12 2012.10.07
2011.10.21 2012.01.21 2012.04.17 2012.07.13 2012.10.08
2011.10.22 2012.01.22 2012.04.18 2012.07.14 2012.10.09
$ cd 2011.10.20
$ ls
00:00 02:25 04:50 07:15 09:40 12:05 14:30 16:55 19:20 21:45
00:05 02:30 04:55 07:20 09:45 12:10 14:35 17:00 19:25 21:50
00:10 02:35 05:00 07:25 09:50 12:15 14:40 17:05 19:30 21:55
$ cd 00:00
$ ls
temps.txt
$ cat temps.txt
Sensor Location Temp
------ -------- ----
#1 PROCESSOR_ZONE 27C/80F
find
to get a list of each file and thensort
on each file to have it sorted by temperature; after that it's a matter of formatting the output to your taste.