![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bash date format | vadharah | UNIX for Dummies Questions & Answers | 1 | 04-01-2008 10:37 AM |
| Perl: Extracting date from file name and comparing with current date | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 01:01 PM |
| Simple date and time calulation in BASH | ripat | Tips and Tutorials | 0 | 10-08-2006 03:15 AM |
| BASH : Find files by date and shred them | cbismuth | Shell Programming and Scripting | 2 | 06-13-2005 08:20 AM |
| Comparing files named by date/time | gillr | UNIX for Dummies Questions & Answers | 2 | 05-30-2005 04:37 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Bash comparing date
Cound anyone help me on how to compare date in Unix using if function on bash file?
current=date if ["$current" = 7/12/06] ###syntax is wrong, could anyone correct it for me then rm -rf /usr/local/src fi Thank You... |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Can anyone give me the syntax for the date to be recognize as date:[yyyy-mm-d]?
|
|
#3
|
||||
|
||||
|
Quote:
Code:
if [ "$current" = "7/12/06" ] ; then rm -rf /usr/local/src fi |
|
#4
|
|||
|
|||
|
it still doesn't work. date:command not found.
#!/bin/sh current=date if ["$current" = "7/12/06"] then echo "test" fi |
|
#5
|
|||
|
|||
|
it worked!!! I just need to put the white spacing.. Thank You
|
|
#6
|
|||
|
|||
|
the bash file worked with no error. But its not comparing the date i wanted it to be executed. Please help. Thank You.
|
|
#7
|
||||
|
||||
|
There are plenty posts about date comparison on this forum, try to search first
|
||||
| Google The UNIX and Linux Forums |