Hi,
I have script in unix which creates a julian date like 126 or 127
I want convert this julian date into calender date
ex : input 127
output 07/may/2007 or 07/05/2007 or 07/05/07
rgds
srikanth (6 Replies)
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)
Hi,
I am trying to display future date from the current date but unable to do so in UNIX (not in PERL). For eg: if today is March 5 then I want a variable wherein I can store Mar 7 date, but unable to get the future date from the current date.
I have tried many possible ways as mentioned below... (11 Replies)
Hi all,
I have used a bash script which ultimately converts a string into date using date --date option:
DATE=$DATE" "$TIME" "`date +%Y` //concatenating 2 strings
TMRW_DATE=`date --date="$DATE" +"%s"` //applying date command on string and getting the unixtime
Please use code tags... (7 Replies)
Hi,
I have date format in an excel sheet as 07/03/2014 11:21. I need to check this date with current date and need to find whether it is more than 30 days or not.
I know how to current date into days, but someone please help me to change the date in the excel sheet to days, so that i can check... (2 Replies)
I am not able to pass date stored in a variable as an argument to date command. I get current date value for from_date and to_date
#!/usr/bin/ksh
set -x
for s in server ; do
ssh -T $s <<-EOF
from_date="12-Jan-2015 12:02:09"
to_date="24-Jan-2015 13:02:09"
echo \$from_date
echo... (7 Replies)
Dear all,
I have an user passing 2 parameter 31/03/2015 and 02/04/2015 to a ksh script. How to print the start date to end date.
Expected output is :
31/03/2015
01/04/2015
02/04/2015
Note :
1. Im using aix and ksh
2. I have tried to convert the given input into a date, didnt... (0 Replies)
Discussion started by: mr.rajaravi
0 Replies
LEARN ABOUT OSF1
unifdef
unifdef(1) General Commands Manual unifdef(1)NAME
unifdef - Removes #ifdefed lines
SYNOPSIS
unifdef [-tlc] [-Dsymbol] [-idsymbol] [-iusymbol] [file] [-Usymbol]
The unifdef command partially simulates the behavior of the C preprocessor in processing #ifdef conditionals.
OPTIONS
Complements the action of unifdef; retains lines that would normally be removed and removes lines that would normally be retained. Speci-
fies symbol as a defined #ifdef symbol. Specifies defined lines inside certain #ifdefs to be ignored but copied out. Specifies undefined
lines inside certain #ifdefs to be ignored and not copied out. Replaces removed lines with blank lines instead of deleting them. Pro-
cesses plain text (rather than C code) input. The unifdef command does not try to recognize comments, single quotes, and double quotes.
Specifies symbol as an undefined #ifdef symbol.
DESCRIPTION
The unifdef command recognizes nested #ifdefs, comments, single and double quotes of C syntax so that it can function correctly, but does
not include files or interpret macros. The unifdef command recognizes, but does not remove comments.
The unifdef command takes its input from stdin if no file argument is given, and copies its output to stdout.
You specify the symbols you want defined with -Dsymbol or undefined with -Usymbol and the lines inside those #ifdefs are copied to the out-
put or removed, as appropriate. The #ifdef, #ifndef, #else, #elif, and endif lines associated with symbol are also removed. The #ifdefs
involving unspecified symbols are untouched and copied out along with their associated #ifdef, #else, elif, and #endif lines. If the same
symbol appears in more than one argument, only the first occurrence is significant. For instance, if an #ifdef X occurs nested inside
another #ifdef X, the inside #ifdef is considered an unrecognized symbol.
If you use #ifdefs to delimit non-C lines, such as comments or unfinished code, it is necessary to specify which symbols are to be used for
that purpose. Otherwise, the unifdef command tries to parse for quotes and comments in those #ifdef lines.
Keywords
The following keywords can be used with the unifdef command:
ifdef ifndef else endif elif
The unifdef command uses the elif keyword as follows. (Note that "Understood" means unifdef knows how to convert elif to if.) Understood
Not understood Not understood
For example:
# ifdef X x # elif defined (Y) y # elif defined (A) || defined (B) a # else default # endif
The following list shows the results of using the elif keyword with variables:
-DX x
-UX # if defined (Y) y # elif defined (A) || defined (B) a # else default # endif -UX -DY y
-UY -UX # if defined (Y) y # elif defined (A) || defined (B) a # else default # endif
-UY -UX -DA # if defined (Y) y # elif defined (A) || defined (B) a # else default # endif
NOTES
The unifdef command cannot process cpp constructs such as:
#if defined(X) || defined(Y)
DIAGNOSTICS
The unifdef command can fail for several reasons: a premature end of file, or an inappropriate else, elif, or endif.
EXIT STATUS
Exit status is 0 if output is an exact copy of input, 1 if not, 2 if the unifdef command fails.
EXAMPLES
The following command line causes the unifdef command to read the file original.c and remove the #ifdef A lines. It then removes every-
thing following an #elif/#else associated with the #ifdef A down to the #endif: unifdef -DA original.c > modified.c The following command
line causes the unifdef command to read the file original.c, and remove the #ifdef A down to either its associated #elif/#else, or its
associated #endif: unifdef -UA original.c > modified.c
In the case of the #elif, the #elif is replaced with #if. In the case of #else, the #else is deleted along with its associated
#endif.
SEE ALSO
Commands: diff(1)unifdef(1)