Dear Member,
i need help in this script
filename_DD_MM_YYYY_HHMMSS.log
this is the log file format
i need to split this name to three variables
1 variables contain filename
2 variables contain _DD_MM_YYY_
3 variables contains HHMMSS
and print the three variables
thanks for you attention
hi Tony how are you
first very thanks for your reply
and sorry for late but some health issue
second
this filename format LOG_FILE_`date '+%d_%m_%Y_%H%M%S'`.log
if i want to do this:-
i have a directory /export/home/dell/log contain a log file
# ls -ltr /export/home/dell/log/*_%d_%m_%Y_* >> /export/home/dell/LogsFor_05_04_2009
# awk -F" " '{print $9}' somelog
by this way i select the last columan only i select the path of the file only
i want to enter every line into script i make it
/export/home/dell/log
Is a directory contain log file the filename format as this
Example:-
Filename_08_04_2009_0800.log
1- I want to select file *_05_04_2009_* and _06_04_2009_* and sort all file by time stamp to know which is run first and what is the second
2- Redirect the output to file
the all of the under /export/home/dell/log with this format
LOG_FILE_`date '+%d_%m_%Y_%H%M%S'`.log
i make this step when i generate i log file t write the status the only thing is difference is the time stap and date couse off of this file is running every week and i have similler file will check and make log every day
for example:-
checkconnect_20_03_2007_180231.log
checkconnect_21_03_2007_180231.log
checkconnect_22_03_2007_180231.log
some files have "_" and some files not
i didn't know what you are take about
Note:
for the first thing i want to make script
# script.bash _DD_MM_YYYY_ _DD_MM_YYYY_
select files which created in the two date and sort it by time stamp this make redirection into file is my main problem
data where select from the following path /export/home/dell/log
file name format is the following
LOG_FILE_`date '+%d_%m_%Y_%H%M%S'`.log
Question:-
# find /export/home/dell/log -name *_20_04_2009_*
the out of this command give me the file sorted by the time stamp
is that right or i make some thing wrong
and if i hope to make this command
# find /export/home/dell/log -name *_20_04_2009_* and *_21_04_2009_* sorted also by time stamp what is the syntex of the command