Sponsored Content
Top Forums Shell Programming and Scripting how to assign the first day of the next month Post 302211949 by rosalinda on Saturday 5th of July 2008 11:05:13 AM
Old 07-05-2008
how to assign the first day of the next month

Hi everybody,
I am very new in shell and this is my first post Smilie.
i am trying to write a script in which i want to decide some begin dates. this dates will be used by another shell scripts.
i would like to assign:
1- a variable which is a = sysdate
2- another variable b = the first day of the next month from sysdate

i want to have time in both, like sysdate is: 20080705 05:02:04,
and the first day of next month to be: 20080801 00:00:05

I appreciate a lot your kind help.
Regards.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies

2. Shell Programming and Scripting

last day of the month

can any one please tell me how can I get the last day of the month Thanks (4 Replies)
Discussion started by: aya_r
4 Replies

3. Shell Programming and Scripting

The last day of the last month

I am a beginner in unix. Can anyone tell me how to get the last day of the last month in 'yyyymmdd' format? eg. today is 20050909, I want to get 20050831. Thanks in advance. (2 Replies)
Discussion started by: emily79
2 Replies

4. Shell Programming and Scripting

determine last day of the month

In a ksh script how do I determine if I am on the last day fo the month ? thanks (4 Replies)
Discussion started by: hanton
4 Replies

5. Shell Programming and Scripting

Script to find previous month last day minus one day timestamp

Hi All, I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this. My Requirment is as below: Input for me will be 2000909(YYYYMM) I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies

6. Shell Programming and Scripting

Code creates day 32 instead of 1st day of next month.

I am using the code below modified from a post I saw here regarding having the script write out future dates. The problem is that instead of making 8/1 it makes 7/32! Please help! yy=`date +%Y` mm=`date +%m` dd=`date +%d` echo "Today is : $yy $mm $dd" #!/usr/bin/ksh date '+%m... (5 Replies)
Discussion started by: libertyforall
5 Replies

7. Shell Programming and Scripting

how can i get the first day of the pre month

how can i get the first day of the pre month in Bash (3 Replies)
Discussion started by: qjlongs
3 Replies

8. Shell Programming and Scripting

Script to counting a specific word in a logfile on each day of this month, last month etc

Hello All, I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer. Any ideas would be appreciated! (5 Replies)
Discussion started by: pnara2
5 Replies

9. Shell Programming and Scripting

Julian day to dates in YEAR-MONTH-DAY

hello, I have many files called day001, day002, day003 and I want to rename them by day20070101, day20070102, etc. I need to do it for several years and leap years as well. What is the best way to do it ? Thank you. (1 Reply)
Discussion started by: Ggg
1 Replies

10. Shell Programming and Scripting

How can I get first day of a particular month?

Hi, I am new to shell scripting and I have a requirement of getting first day of specific month. eg i need 1st day of oct 2014 October 2014 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 output... (4 Replies)
Discussion started by: simsim90
4 Replies
Time::CTime(3pm)					User Contributed Perl Documentation					  Time::CTime(3pm)

NAME
Time::CTime -- format times ala POSIX asctime SYNOPSIS
use Time::CTime print ctime(time); print asctime(localtime(time)); print strftime(template, localtime(time)); strftime conversions %% PERCENT %a day of the week abbr %A day of the week %b month abbr %B month %c ctime format: Sat Nov 19 21:05:57 1994 %d DD %D MM/DD/YY %e numeric day of the month %f floating point seconds (milliseconds): .314 %F floating point seconds (microseconds): .314159 %h month abbr %H hour, 24 hour clock, leading 0's) %I hour, 12 hour clock, leading 0's) %j day of the year %k hour %l hour, 12 hour clock %m month number, starting with 1, leading 0's %M minute, leading 0's %n NEWLINE %o ornate day of month -- "1st", "2nd", "25th", etc. %p AM or PM %r time format: 09:05:57 PM %R time format: 21:05 %S seconds, leading 0's %t TAB %T time format: 21:05:57 %U week number, Sunday as first day of week %v DD-Mon-Year %w day of the week, numerically, Sunday == 0 %W week number, Monday as first day of week %x date format: 11/19/94 %X time format: 21:05:57 %y year (2 digits) %Y year (4 digits) %Z timezone in ascii. eg: PST DESCRIPTION
This module provides routines to format dates. They correspond to the libc routines. &strftime() supports a pretty good set of coversions -- more than most C libraries. strftime supports a pretty good set of conversions. The POSIX module has very similar functionality. You should consider using it instead if you do not have allergic reactions to system libraries. GENESIS
Written by David Muir Sharnoff <muir@idiom.org>. The starting point for this package was a posting by Paul Foley <paul@ascent.com> LICENSE
Copyright (C) 1996-2010 David Muir Sharnoff. Copyright (C) 2011 Google, Inc. License hereby granted for anyone to use, modify or redistribute this module at their own risk. Please feed useful changes back to cpan@dave.sharnoff.org. perl v5.12.3 2011-05-12 Time::CTime(3pm)
All times are GMT -4. The time now is 05:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy