![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Manipulation of Date in Shell | jnanesh.b | Shell Programming and Scripting | 1 | 01-11-2008 01:16 PM |
| Date Manipulation | mgirinath | Shell Programming and Scripting | 6 | 04-03-2007 05:25 AM |
| Help with log manipulation | StevePace | Shell Programming and Scripting | 3 | 01-31-2006 08:28 PM |
| date manipulation | jalburger | Shell Programming and Scripting | 3 | 05-10-2004 02:09 PM |
| Time/date manipulation | choice | High Level Programming | 1 | 02-01-2002 04:06 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
date manipulation
HI,
I'm comparing my file date with the system date and if both the dates are equal I'm doing some operation. I use two variables for these two dates. I use the following command in my query. if [ $cd=$fdate].... But here the current date $cd shows 01 and filedate $fdate shows 1. The file is created on 1 of the month. Because of this the condition is not matching and goes to else part of my pgm. Why it is showing filedate as 1 while listing? How to manipulate this? Kindly let me know. Thanks in advance. pstanand |
|
||||
|
under ksh you can use typeset when defining your variables...it'll level the presentation and therefore evaluation of the values: Code:
$ cd="01" $ fdate="1" $ echo $cd $fdate 01 1 $ typeset -i cd="01" $ typeset -i fdate="1" $ echo $cd $fdate typeset does not provide for an export, however. You'd need to do this separately... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|