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
1 Replies
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
2 Replies
3. HP-UX
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
4. 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
3 Replies
5. Shell Programming and Scripting
Hi, please can somebody let me know the easiest way to add days to a date.
I can do this in perl but would like to able to do it in a shell script.
Desired output would be:
date +'%Y-%m-%d' + 10 = 2016-05-02
Thank you (8 Replies)
Discussion started by: andy391791
8 Replies
6. Windows & DOS: Issues & Discussions
Hi,
I'm writing an batch file to create report
In the batch file iam passing two arguments:startdate and finishdate
Ex: startdate=07-sep-2009 finishdate=07-sep-2011
I need to have script that takes command line argument as input and gives me out currentdate last year and current date... (2 Replies)
Discussion started by: anand1773
2 Replies
7. Shell Programming and Scripting
Hi,
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
15 Replies
8. Shell Programming and Scripting
Hello Unix gurus,
I need to add days to the input date and further use it in comparision with the existing date.
Im having issues sto add days to date,can you guys help me with script or function with which I can add days to the date.
Thanks,
Sud (10 Replies)
Discussion started by: sud
10 Replies
9. Shell Programming and Scripting
I am currently running the following Korn shell script which works fine:
#!/usr/bin/ksh
count=`db2 -x "select count(*) from schema.tablename"`
echo "count"
I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies
10. UNIX for Dummies Questions & Answers
how can we add or subtract days from the output of date command in unix...
like if i want to subtract a day from the result of date command like this..
v_date=`date +%Y%m%d`
this wud give me 20080519
now i want to subtract one day from this.. so tht it wud give me 20080518..
how do i do... (1 Reply)
Discussion started by: St.Fartatric
1 Replies