10 More Discussions You Might Find Interesting
1. Homework & Coursework Questions
I am running a script in ksh to get the 2 months back date from system date.The below code is giving correct date output from putty command prompt.But while running the script is .ksh file it is giving the error below.Please suggest.
; d=a; y=a
m-=num
while(m < 1) {m+=12; y--}... (1 Reply)
Discussion started by: hini
1 Replies
2. AIX
As said in object, how can i obtain that?
In linux i use date -d "1 month" +"%m%Y".
Thanks i advance. (8 Replies)
Discussion started by: fabfisc
8 Replies
3. Shell Programming and Scripting
I have requirment to get last date of previous month and the first date of previous 4th month:
Example:
Current date: 20130320 (yyyymmdd)
Last date of previous month: 20130228 (yyyymmdd)
First date of previous 4th month: 20121101 (yyyymmdd)
In my shell --date, -d, -v switches are not... (3 Replies)
Discussion started by: machomaddy
3 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I am using the below code to get the year and month from date:
Below gives output like 201212.
dt=`date '+%Y%m'`
how do i get the previous month value(ie: subtract 1 from date)
example output:
dt=201211
Please help. :confused: (3 Replies)
Discussion started by: abhi_123
3 Replies
5. Shell Programming and Scripting
Hi,
i unable to get the last month date in AIX.
current date - one month
Based on the forums tried but did not find the relevent information.
Any help grealy appriciated.
Thanks
Suri. (3 Replies)
Discussion started by: onesuri
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
On any given day, I want to capture the month that has gone by - said otherwise, how do I capture last month?
expr date '+%m' - 1
Above expression is giving error.
Please advise
thanks
---------- Post updated at 09:28 AM ---------- Previous update was at 09:11 AM... (1 Reply)
Discussion started by: ab_2010
1 Replies
7. Shell Programming and Scripting
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
8. UNIX for Dummies Questions & Answers
Hello,
I'm new to shell scripting.
We've develop a script which will grep a file on the search criteria, MON (Jan/Feb/Mar/etc). But we should set this sript in cron which will run on every first day of the month. The problem I'm having is, when I run the script, it is displaying the contents of... (7 Replies)
Discussion started by: suneelj
7 Replies
9. Shell Programming and Scripting
Hello,
I wanted to display the month for previous day date. Like, today date is 18-Nov-2008. So the previous date is 17-Nov-2008. The output should be November.
If the today date is 1-DEC-2008, then output should be NOVEMBER.
If the today date is 1-JAN-2008, then output should be DECEMBER.... (4 Replies)
Discussion started by: govindts
4 Replies
10. Shell Programming and Scripting
Hi, I'm new with Unix, I'm trying to get a last day of previous month with this format: %b %d %Y (example: Feb 25 2008).
Here is what I have so far.
#!/bin/ksh
cur_month=`date +%m`
cur_year=`date +%Y`
prev_month=$(($cur_month-1))
# Check to see if this is January
if
then
... (11 Replies)
Discussion started by: sirrtuan
11 Replies
XCALPR(1) General Commands Manual XCALPR(1)
NAME
xcalpr - print xcal calendar entries
SYNTAX
xcalpr [ -c ][ -x ][ -f file ][ -d dir ][ -u user ][ date-spec ]
DESCRIPTION
Xcalpr prints the contents of the xcal files. It is intended to be used in situations when you have no access to an X screen. It can also
be used to generate entries for the standard UNIX calendar program.
With no arguments, it prints any entries that exist for the next seven days. The program also reads the contents of the seven daily files
and prints them at the appropriate point in the output stream. Each line in the output is preceded by the day of the week, the day of the
month, the month and the year.
Xcalpr can be given a date specification to select months and years. If the date spec consists of just a year number, then all the data
for that year is printed. For example:
xcalpr 1994
will print all the data for 1994. Several years can be specified.
If you give the name of a month, then the data for that month in the current year will be printed. If the month is in the past, then the
data for that month next year will be printed. For example, if
xcalpr oct jan
is typed in August, xcalpr will print October in the current year and January next year.
You can select a particular year by adding the number after any months that you need printing:
xcalpr oct nov 1994
will print October and November in 1994.
There are a couple of special `month' names. The name rest will print the data for the rest of the month, starting tomorrow. The rest
argument is not recognised if you give a year as a parameter. If tomorrow happens to be the first day of the next month, then all the data
for next month will be printed. The name next prints all the data for next month.
OPTIONS
The -c option causes xcalpr to output lines suitable for input to the standard UNIX calendar program.
The -d switch is followed by a directory name and specifies an alterative location for your Calendar directory. Your home directory is
prepended if the name doesn't start with a slash or a dot.
The -f option is followed by a file name and xcalpr will write it's output to that file, rather than standard output.
The -u option is followed by a user name and dumps their calendar files rather than yours.
The -x option makes xcalev operate with Calendar files that are compatible with the xcalendar program.
FILES
$HOME/Calendar/*
xc<dd><Mon><Year> A data file is day, Month in three letter format and the year.
xy<Year> A year directory.
xw<Day> A data file for the weekly code, one per day.
SEE ALSO
xcal(1), xcalev(1), xcal_cal(1)
AUTHOR
Copyright 1993 by Peter Collinson, Hillside Systems All rights reserved.
This product includes software developed by the University of California, Berkeley and its contributors.
X Version 11 R5 October 1993 XCALPR(1)