10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to compare identically named files in different directories and replace a file only with a newer version. Is there a way of doing this?
TIA (4 Replies)
Discussion started by: wbport
4 Replies
2. Shell Programming and Scripting
Dear all, I'm stuck on Solaris 9 bash (I believe is quite different from Linux system) trying to find a solution.
I have one file named like:120629-1750-TERZ81_AS_YTR.txt
YYMMDD-HH-MM-......The script should compare the actual date with the one reported on the file name and then take an action... (4 Replies)
Discussion started by: Lord Spectre
4 Replies
3. Shell Programming and Scripting
I have a file
$ cat myfile
A 02/16/2012
B 02/19/2012
C 02/20/2012
D 02/17/2012
E 02/16/2012
My simple script
> cat myscript.sh
mydate="02/16/2012"
awk ' ($2~/$mydate/) {print $1}' < myfile
but I got no output! and when I try $2~/'$mydate'/
I got: The error context is (2 Replies)
Discussion started by: Sara_84
2 Replies
4. UNIX for Dummies Questions & Answers
Hi Guys,
Anyone who knows how to compare the current date with the a file containing a date, say for example I have a file that looks like this:
Command was launched from partition 0.
------------------------------------------------
Executing command in server server6
Fri Dec 16... (7 Replies)
Discussion started by: rymnd_12345
7 Replies
5. Shell Programming and Scripting
Hi,
I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing.
The above requirement i want in Shell script(KSH)...
Can any one please help me?
Double post, continued here. (0 Replies)
Discussion started by: kumarmsk1331
0 Replies
6. Shell Programming and Scripting
Hi,
I have start date and end date in the following format. I need to check the current date is greater than the start date and less than the end date. if i use the command date --date "Tue 6:00 AM", it takes next Tues day not the current week's Tues day. Is there a way to get the current Tues... (9 Replies)
Discussion started by: bharathappriyan
9 Replies
7. Emergency UNIX and Linux Support
Hi all,
I have written a script which stores data along with requisite dates in a file.
I need to compare the stored date values in the file to obtain the row with the highest date value i.e. the recent most entered record in the file.
Please help cause i dont know how we can compare dates in... (10 Replies)
Discussion started by: sumi_mn
10 Replies
8. Linux
Daily one file will dropped into this directory.
Directory: /opt/app/jt/drop
File name: XXXX_<timestamp>.dat.gz
I need to write a script which checks whether the file is dropped daily or not.
Any idea in the script how can we compare timestamp of the file to today's date?? (3 Replies)
Discussion started by: Rajneel
3 Replies
9. Shell Programming and Scripting
I need to extract the date part from the file name (20080221 in this ex) and compare it with the current date and delete it, if it is a past date.
$file = exp_ABCD4_T-2584780_upto_20080221.dmp.Z
really appreciate any help.
thanks
mkneni (4 Replies)
Discussion started by: MKNENI
4 Replies
10. UNIX for Dummies Questions & Answers
Cound anyone help me on how to compare date in Unix using if function on bash file?
current=date
if ###syntax is wrong, could anyone correct it for me
then
rm -rf /usr/local/src
fi
Thank You... (17 Replies)
Discussion started by: Stanford Co
17 Replies