12-05-2001
Re: How to compare prev day file to current day file
Quote:
Originally posted by Smurtzy
Sound like a nightmare??? It is. Here is what I have so far, but I am having a problem figuring out how to name/compare files....
Any help would be greatly appreciated!
Well if you want to do something like:
diff $TODAYSFILE $YESTERDAYSFILE
then there are several ways to determine yesterdays date. Search the board because this is a frequently asked question. (Don't think it officially made it to the FAQ section yet though)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
I am relatively new to unix...
Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell..
This is very urgent.
Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I want to check what day is today (like mon,Tue,wed)
When i checked the syntax, i dont see there is a format specifier for getting the day. Let me know how to get the same.
I am very new to unix and so I am asking some basic questions.
cheers,
gops (2 Replies)
Discussion started by: gopskrish
2 Replies
3. Shell Programming and Scripting
We have data files that are ftp'd every morning to a SUN server. The file names are exactly the same except for that each has the date included in its name. I have to write script to do 2 things:
STEP 1) Verify that the file arrived in morning.
STEP 2) Compare the file size of the current... (3 Replies)
Discussion started by: rbknisely
3 Replies
4. Shell Programming and Scripting
Hi All,
I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this.
My Requirment is as below:
Input for me will be 2000909(YYYYMM)
I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies
5. Shell Programming and Scripting
Hi All,
can anyone pls share the command to list the files of current day only. i want to check if there are any files in a particular directory which are not of current date. (6 Replies)
Discussion started by: josephroyal
6 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day.
i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies
7. Shell Programming and Scripting
My objective is to get the non matching records of previous day with current day.
eg, file1 contains
1 a
2 b
and file2 contains:
2 b
3 c
then expected output is
3 c¨
another example
file 1 contains:
1 a
2 b
file 2 contains
1 c
2 b (8 Replies)
Discussion started by: newbie2014
8 Replies
8. UNIX for Dummies Questions & Answers
i want to save current day file daily
for this is am using below command.
cp -p $(ls -lrt | grep "Apr 15" | awk '{print $9}'
in order to script this part, i am saving date output in a file using below command
date | awk '{print $2,$3}' >>t1
thru below command i want to list the file of... (7 Replies)
Discussion started by: scriptor
7 Replies
9. UNIX for Beginners Questions & Answers
Hi,
I tested this :
#!/bin/bash
set +x
CurrentDay=$(date +'%a') (Fri) on my server
Fri=$(date -d "Friday" | awk '{print $1}')
Sat=$(date -d "Saturday" | awk '{print $1}')
if ] ; then echo "ok" ; else echo "ok" ; fi
But the output tell me always "ok" why?! Thanks in advance :b: (5 Replies)
Discussion started by: Arnaudh78
5 Replies
10. UNIX for Beginners Questions & Answers
I Have text like
XXX_20190908.csv.gz need to replace Only date in this format with current date every day
Thanks! (1 Reply)
Discussion started by: yamasani1991
1 Replies
ZDIFF(1) General Commands Manual ZDIFF(1)
NAME
zcmp, zdiff - compare compressed files
SYNOPSIS
zcmp [ cmp_options ] file1 [ file2 ]
zdiff [ diff_options ] file1 [ file2 ]
DESCRIPTION
Zcmp and zdiff are used to invoke the cmp or the diff program on files compressed via gzip. All options specified are passed directly to
cmp or diff. If only file1 is specified, it is compared to the uncompressed contents of file1.gz. If two files are specified, their con-
tents (uncompressed if necessary) are fed to cmp or diff. The input files are not modified. The exit status from cmp or diff is pre-
served.
SEE ALSO
cmp(1), diff(1), zmore(1), zgrep(1), znew(1), zforce(1), gzip(1), gzexe(1)
BUGS
Messages from the cmp or diff programs may refer to file names such as "-" instead of to the file names specified.
ZDIFF(1)