Search Results

Search: Posts Made By: jayadanabalan
2,401
Posted By Scrutinizer
Try with the original time format in post#1: ...
Try with the original time format in post#1:
awk -F: '{m=$1*60+$2+$3/60; d=(m-p)} d<0{d+=1440} NR>1{printf "%.0f\n", d} {p=m}' file

If the difference is negative it is assumed there is one day...
2,938
Posted By ahamed101
Assuming you have only one file created everyday ...
Assuming you have only one file created everyday
file=file.txt.$(date +%Y%m%d)*
test -f $file && mv "$file" "${file/./_first.}"

--ahamed
2,938
Posted By Scott
if test -f file.txt.$(date +%Y%m%d)*; then ...
if test -f file.txt.$(date +%Y%m%d)*; then
echo Found!
fi


Example:

$ touch file.txt.$(date +%Y%m%d%H%M%S)

$ ls file.txt*
file.txt.20130925030644

$ if test...
2,938
Posted By Chubler_XL
You should be OK using: file.txt.$(date +%Y%m%d)*
You should be OK using: file.txt.$(date +%Y%m%d)*
1,268
Posted By ctsgnb
awk '/tea/' RS= FS="\n" yourfile or awk...
awk '/tea/' RS= FS="\n" yourfile

or

awk '/tea/' RS= FS="\n" ORS="\n\n" yourfile
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 10:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy