10 More Discussions You Might Find Interesting
1. Answers to Frequently Asked Questions
I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
2. UNIX for Beginners Questions & Answers
Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt .
I don't want to delete... (2 Replies)
Discussion started by: Stuti
3. Shell Programming and Scripting
I get the date that's inside a text file and assigned it to a variable. When I grep the date from the file, I get this,
Not After : Jul 28 14:09:57 2017 GMT
So I only crop out the date, with this command
echo $dateFile | cut -d ':' -f 2,4The result would be
Jul 28 14:57 2017 GMT
How do I... (3 Replies)
Discussion started by: Loc
4. Shell Programming and Scripting
How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt
how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Discussion started by: hemanthsaikumar
5. Shell Programming and Scripting
I'd like to write a monthly archive script that archives some logs. But I'd like to do it based on yesterday's date. In other words, I'd like to schedule the script to run on the 1st day of each month, but have the archive filename include the previous month instead.
Here's what I... (5 Replies)
Discussion started by: nbsparks
6. Shell Programming and Scripting
I want to get tomorrow and yesterday date from date command. My shell is KSH and server is AIX. I tried several options, but unable to do. Please help on this.
Rajesh (5 Replies)
Discussion started by: rajeshmepco
7. Shell Programming and Scripting
I have a file like this:
in case the content of the file has the date of yesterday within the lines containing pattern AB this should be replaced by the current date. But if I use... (3 Replies)
Discussion started by: Lilu_CK
8. Shell Programming and Scripting
Hi! I am trying to read a file and every line has a specific date as one of its fields.
I want to take that date and compare it to the date today plus 6 days.
while read line
date=substr($line, $datepos, 8) #date is expected to be YYYYMMDD
if ; then
... (1 Reply)
Discussion started by: kokoro
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
Anybody knows how to get what date was 28 days ago of the current system date through UNIX script.
Ex : - If today is 28th Mar 2010 then I have to delete the files which arrived on 1st Mar 2010, (15 Replies)
Discussion started by: kandi.reddy