06-30-2015
Looks like your shell doesn't zero pad the MONTH sequence as does my bash. You may want to consider the various options that your shell offers for "brace expansion". Otherwise, prepend single digit MONTHs with a "0" by shell means.
---------- Post updated at 09:40 ---------- Previous update was at 09:39 ----------
or, use seq -w 1 12.
This User Gave Thanks to RudiC For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Is there a way to setup a cronjob that will only run on the first monday of the month? (3 Replies)
Discussion started by: molonede
3 Replies
2. Shell Programming and Scripting
Hi,
I am trying to do achieving of files by months.
find /test -name \*.* -mtime +30
will give me the result of all modified files after 30 days.
But lets say i want to list all files that is modified in last months... what is the command to do it?
Thanks! (13 Replies)
Discussion started by: maldini
13 Replies
3. Shell Programming and Scripting
Help please! I need to read the calendar and put the date of the third Friday of each month into a variable for comparison in an "if" statement. How would I do this?
Thnx,
leslie02 (10 Replies)
Discussion started by: leslie02
10 Replies
4. UNIX for Dummies Questions & Answers
I would like to find out the month from a given date,
how is it possible. (5 Replies)
Discussion started by: rudoraj
5 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I need to display the date of the first monday of a month.
Can any one please help me on this.
Thanks in advance. (6 Replies)
Discussion started by: Sheethal
6 Replies
6. UNIX for Dummies Questions & Answers
I know I can't schedule this in cron and would have to write a wrapper around my script and schedule it in cron ....but not sure how do to this?
How do I exclude Monday if the 2nd day of the month falls on a Monday?
Thanks.
I tried this:
0 0 2 * 0,2-6 command
And I know this doesnt... (2 Replies)
Discussion started by: newtou
2 Replies
7. UNIX for Advanced & Expert Users
Hi,
Could any one please let me know the crontab entry for scheduling a job for every first monday of the month?
Thank You in advance,
Sue (2 Replies)
Discussion started by: pyaranoid
2 Replies
8. HP-UX
Hi All
Any one please suggest me...
I have one directory every monday one file will be created in that directory. so if the file is created on monday or not i need check first.
How can write a script??? if the file is not created i want to quit from script.
Thanks
K.Srinivas (5 Replies)
Discussion started by: k_s_rao7
5 Replies
9. UNIX for Advanced & Expert Users
Hi All,
I need to find last two files for the month.
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 15:43 c.txt
-rwxr-xr-x 1 user userg 1596 Mar 21 15:43 d.txt
-rwxr-xr-x 1 user userg 1596 Mar 22 15:43 f.txt
-rwxr-xr-x 1... (14 Replies)
Discussion started by: Makarand Dodmis
14 Replies
10. Shell Programming and Scripting
Hi,
I want two dates one will be the current date and the other one will be just one month before. Say if current month is 11/4/2014 then the other date should be 11/3/2014.
#!/bin/ksh
currentDtae=`date`
oneMonthBefore= ?
I dont know how to do it. Went through some of the related threads... (15 Replies)
Discussion started by: Sharma331
15 Replies
LEARN ABOUT PHP
cal_from_jd
CAL_FROM_JD(3) 1 CAL_FROM_JD(3)
cal_from_jd - Converts from Julian Day Count to a supported calendar
SYNOPSIS
array cal_from_jd (int $jd, int $calendar)
DESCRIPTION
cal_from_jd(3) converts the Julian day given in $jd into a date of the specified $calendar. Supported $calendar values are CAL_GREGORIAN,
CAL_JULIAN, CAL_JEWISH and CAL_FRENCH.
PARAMETERS
o $jd
- Julian day as integer
o $calendar
- Calendar to convert to
RETURN VALUES
Returns an array containing calendar information like month, day, year, day of week, abbreviated and full names of weekday and month and
the date in string form "month/day/year".
EXAMPLES
Example #1
cal_from_jd(3) example
<?php
$today = unixtojd(mktime(0, 0, 0, 8, 16, 2003));
print_r(cal_from_jd($today, CAL_GREGORIAN));
?>
The above example will output:
Array
(
[date] => 8/16/2003
[month] => 8
[day] => 16
[year] => 2003
[dow] => 6
[abbrevdayname] => Sat
[dayname] => Saturday
[abbrevmonth] => Aug
[monthname] => August
)
SEE ALSO
cal_to_jd(3), jdtofrench(3), jdtogregorian(3), jdtojewish(3), jdtojulian(3), jdtounix(3).
PHP Documentation Group CAL_FROM_JD(3)