![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compare date from db2 table to yesterday's Unix system date | sasaliasim | Shell Programming and Scripting | 9 | 12-01-2008 11:37 PM |
| Perl: Extracting date from file name and comparing with current date | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 04:01 PM |
| Changing Creation Date to a Prespecified Date of a File In Unix | monkfan | UNIX for Dummies Questions & Answers | 4 | 11-28-2006 07:15 AM |
| compare today's date with date in a file | siog | UNIX for Dummies Questions & Answers | 4 | 10-04-2006 11:55 AM |
| Log File date compare for user defined range | mojo24 | Shell Programming and Scripting | 0 | 05-05-2006 06:39 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
compare date with date in file
Hello everyone, I'm in desperate need of your help for this challenge I have below:
The run_dt_tbl has only 1 column and 1 row that contains a particular date in format mmddyy. I want to some how compare today's date with the date in this table that will be preset by someone else. If the dates match, run a bunch of procedures and unix commmands. If the dates do not match, do nothing. Below is the framework, please, please help lead me in the right direction to making this work. I am very new to unix scripting. Thank you so very much. #!/bin/sh today = date +%m%d%y /* setting today's date format to mmddyy */ run_date = 'the result of select * from run_dt_tbl' if [$today -eq $run_date] then sqlplus -s <<EOF username/password @/dir_a/file1.prc > /dir_b/file1.log @/dir_a/file2.prc > /dir_b/file2.log exit EOF cp /dir_c/out1.txt /dir_d/out1.$(date +%m%d%y:%H%M%S) else do nothing /*not sure how to say do thing. should it be sleep? */ fi |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|