Sponsored Content
Full Discussion: Date Compare
Top Forums UNIX for Dummies Questions & Answers Date Compare Post 72922 by vivekshankar on Wednesday 25th of May 2005 01:55:19 PM
Old 05-25-2005
hi,
i used the foll method to compare

read startdt

$a = `echo ls -l | cut 44-52` (this returns jus a single line cause i am reading line by line)

if $a-ge$startdt then
echo "hello"
fi

but even if $ is no greater than $startdate all resuts are shown
for eg $a is 20050520 and startdate is 20050603
even now $a is greater than startdate condition succeds

what am i doin wrong?
how can solve this?

regards
vivek.s
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

compare today's date with date in a file

Hi I am very new to scripting, Can someone show me how to (in unix shell script) compare the system's date with a date in a file. The requirement is to somehow open this file (which will only have a date in it) and compare it with today's date. If they are equal execute a procedure below but if... (4 Replies)
Discussion started by: siog
4 Replies

2. Shell Programming and Scripting

Compare date from db2 table to yesterday's Unix system date

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

3. Shell Programming and Scripting

ksh compare dates INSIDE a file (ie date A is > date B)

In KSH, I am pasting 2 almost identical files together and each one has a date and time on each line. I need to determine if the first instance of the date/time is greater than the 2nd instance of the date/time. If the first instance is greater, I just need to echo that line. I thought I would... (4 Replies)
Discussion started by: right_coaster
4 Replies

4. Shell Programming and Scripting

Adding days to system date then compare to a date

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 do date=substr($line, $datepos, 8) #date is expected to be YYYYMMDD if ; then ...proceed commands ... (1 Reply)
Discussion started by: kokoro
1 Replies

5. Shell Programming and Scripting

Compare Date with String in date format

Hi, I am new to this forum, searched, but for some reason did not find much help, so a new thread. I am trying to compare date with a string which is in date format , but for some reason, system does not give me the right result. Date is coming in a file and i am comparing the same with... (2 Replies)
Discussion started by: mkstool
2 Replies

6. Shell Programming and Scripting

Shell script to compare two files of todays date and yesterday's date

hi all, 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
4 Replies

7. Shell Programming and Scripting

Compare the system date with date from a text file

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

8. UNIX for Beginners Questions & Answers

Compare date in .txt with system date and remove if it's lesser than system date

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

9. Answers to Frequently Asked Questions

Compare date in .txt with system date and remove if it's lesser than system date

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

10. UNIX for Beginners Questions & Answers

Compare Date to today's date in shell script

Hi Community! Following on from this code in another thread: #!/bin/bash file_string=`/bin/cat date.txt | /usr/bin/awk '{print $5,$4,$7,$6,$8}'` file_date=`/bin/date -d "$file_string"` file_epoch=`/bin/date -d "$file_string" +%s` now_epoch=`/bin/date +%s` if then #let... (2 Replies)
Discussion started by: Greenage
2 Replies
IPSEC_OPENAC(8) 					      System Manager's Manual						   IPSEC_OPENAC(8)

NAME
ipsec openac - Generation of X.509 attribute certificates SYNOPSIS
ipsec openac [ --help ] [ --version ] [ --optionsfrom filename ] [ --quiet ] [ --debug level ] [ --days days ] [ --hours hours ] [ --startdate YYYYMMDDHHMMSSZ ] [ --stopdate YYYYMMDDHHMMSSZ ] --cert certfile --key keyfile [ --password password ] --usercert certfile --groups attr1,attr2,... --out filename DESCRIPTION
openac is intended to be used by an Authorization Authority (AA) to generate and sign X.509 attribute certificates. Currently only the inclusion of one ore several group attributes is supported. An attribute certificate is linked to a holder by including the issuer and serial number of the holder's X.509 certificate. OPTIONS
--help display the usage message. --version display the version of openac. --optionsfrom filename adds the contents of the file to the argument list. If filename is a relative path then the file is searched in the directory /etc/openac. --quiet By default openac logs all control output both to syslog and stderr. With the --quiet option no output is written to stderr. --days days Validity of the X.509 attribute certificate in days. If neiter the --days nor the --hours option is specified then a default valid- ity interval of 1 day is assumed. The --days option can be combined with the --hours option. --hours hours Validity of the X.509 attribute certificate in hours. If neiter the --hours nor the --days option is specified then a default valid- ity interval of 24 hours is assumed. The --hours option can be combined with the --days option. --startdate YYYYMMDDHHMMSSZ defines the notBefore date when the X.509 attribute certificate becomes valid. The date YYYYMMDDHHMMSS must be specified in UTC (Zulu time). If the --startdate option is not specified then the current date is taken as a default. --stopdate YYYYMMDDHHMMSSZ defines the notAfter date when the X.509 attribute certificate will expire. The date YYYYMMDDHHMMSS must be specified in UTC (Zulu time). If the --stopdate option is not specified then the default notAfter value is computed by adding the validity interval speci- fied by the --days and/or --days options to the notBefore date. --cert certfile specifies the file containing the X.509 certificate of the Authorization Authority. The certificate is stored either in PEM or DER format. --key keyfile specifies the encrypted file containing the private RSA key of the Authoritzation Authority. The private key is stored in PKCS#1 format. --password password specifies the password with which the private RSA keyfile defined by the --key option has been protected. If the option is missing then the password is prompted for on the command line. --usercert certfile specifies file containing the X.509 certificate of the user to which the generated attribute certificate will apply. The certificate file is stored either in PEM or DER format. --groups attr1,attr2 specifies a comma-separated list of group attributes that will go into the X.509 attribute certificate. --out filename specifies the file where the generated X.509 attribute certificate will be stored to. Debugging openac produces a prodigious amount of debugging information. To do so, it must be compiled with -DDEBUG. There are several classes of debugging output, and openac may be directed to produce a selection of them. All lines of debugging output are prefixed with ``| '' to distinguish them from error messages. When openac is invoked, it may be given arguments to specify which classes to output. The current options are: --debug level sets the debug level to 0 (none), 1 (normal), 2 (more), 3 (raw), and 4 (private), the default level being 1. EXIT STATUS
The execution of openac terminates with one of the following two exit codes: 0 means that the attribute certificate was successfully generated and stored. 1 means that something went wrong. FILES
/etc/openac/serial serial number of latest attribute certificate SEE ALSO
The X.509 attribute certificates generated with openac can be used to enforce group policies defined by ipsec.conf(5). Use ipsec_auto(8) to load and list X.509 attribute certificates. For more information on X.509 attribute certificates, refer to the following IETF RFC: RFC 3281 An Internet Attribute Certificate Profile for Authorization HISTORY
The openac program was originally written by Ariane Seiler and Ueli Galizzi. The software was recoded by Andreas Steffen using strongSwan's X.509 library and the ASN.1 code synthesis functions written by Christoph Gysin and Christoph Zwahlen. All authors were with the Zurich University of Applied Sciences in Winterthur, Switzerland. BUGS
Bugs should be reported to the <users@lists.strongswan.org> mailing list. 22 September 2007 IPSEC_OPENAC(8)
All times are GMT -4. The time now is 12:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy