HI,
I am able to find days difference using FIND command. However it is comparing between today and the last time it was modified.
I now need to find the difference between a date specified by myself and the last time the file was modified. Is there a command which I can use or I have to... (1 Reply)
hi ,
I have two variables both containg dates,
x= `date`
and
y= `date'
their format being -> Fri Nov 12 22:59:50 MST 2004
how do I compare which one is greater.
->Can dates be converted into integer and then compared?
( one lengthy way would be to compare the words one by... (7 Replies)
Hi All.
Can someone please give me an example of how I'd do a comparison to find out if the last modified date of a file is newer than yesterday (i.e. today - 1 day)?
Example:
if ; then
echo "Do something..."
fi
Any ideas or examples?
Thanks. (1 Reply)
Hi I have yesterday date and todays date stored in two variables.
Today date is stored in variable -- testdate=`date +%m/%d/%Y`
I found the yesterday date and stored in variable -- ydate=$month'/'$day1'/'$year
Now i am trying to find out whether $testdate is less that $ydate.
I am... (6 Replies)
Hi,
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.One more condition is change of year also i.e today is Jan1 2012 and yesterday is Dec 31 2011.
The above rek i want in Shell... (4 Replies)
Hi
I'm trying to compare the current date (dd-Mmm-yyyy) against a variable that is an extracted date from an sql script. Below is the code:
datenow=`date '+%d-%h-%Y'`
#datenow is the current date in the format dd-Mmm-yyyy
sqlplus $dbuserid/$dbpassword @ $SCRIPT_PATH/business-date.sql >... (3 Replies)
Hi,
can we do date comparisons in unix? like if i give the two dates find which date is old one and which is new one and difference between the two dates in terms of hours,minutes,days and months. (1 Reply)
Hi
I am failing to write a script which compares a list of dates in a file with today's date.
OS: Solaris 10
I have a file which has server names & dates, i need to compare the date in this file with today's date, if it is less than today it should print the server name.
code i tried is ... (3 Replies)
Discussion started by: nanz143
3 Replies
LEARN ABOUT X11R4
shift
shift(1) User Commands shift(1)NAME
shift - shell built-in function to traverse either a shell's argument list or a list of field-separated words
SYNOPSIS
sh
shift [n]
csh
shift [variable]
ksh
* shift [n]
DESCRIPTION
sh
The positional parameters from $n+1 ... are renamed $1 ... . If n is not given, it is assumed to be 1.
csh
The components of argv, or variable, if supplied, are shifted to the left, discarding the first component. It is an error for the variable
not to be set or to have a null value.
ksh
The positional parameters from $n+1 $n+1 ... are renamed $1 ..., default n is 1. The parameter n can be any arithmetic expression that
evaluates to a non-negative number less than or equal to $#.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), ksh(1), sh(1), attributes(5)SunOS 5.10 15 Apr 1994 shift(1)