01-19-2008
Cal question
This probably would be a cake walk for you, but i am having trouble with this.
I am trying to print every tuesday of the month from cal, and the FS default is space. There is one row that has few spaces at the beginning and so when i print $3, those spaces get ingnored and a different day gets printed. How can i ractify this problem? Thanks for your help.
Vin
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to configure the cal command to recognize the month names.
When you type: cal - you get the calander for the current month of the current year.
Is there a way of making the system recognize March, and Mar. So I could type:
cal March or cal mar and get the same response as cal.... (5 Replies)
Discussion started by: Astudent
5 Replies
2. UNIX for Dummies Questions & Answers
hey everyone. I'm new to UNIX, and I'm having trouble with the cal command. I know that you can display a calendar if you just type in 'cal 3 2005' for example. But how would you do it if you just wanted the calendars displayed to be from March 2005 to June 2005?
Thanks (4 Replies)
Discussion started by: pythonman
4 Replies
3. Shell Programming and Scripting
Hi Gurus,
In my Cal output i want to cut the date of 2nd saturday how tyo achive this.
for eg in the below output i need that second saturday 13 to be cut.
crypto $ cal
January 2007
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... (2 Replies)
Discussion started by: Krrishv
2 Replies
4. UNIX for Advanced & Expert Users
Cal
Sun Mon Tue Wed Thu Fri Sat
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
cal | awk '{print $7}'
Sat
13
20
27
In the above output i am missing 6 because the first column is empty so it is shfting.
How... (3 Replies)
Discussion started by: ukatru
3 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I wanted to display calender for the previou, current and next month in a single command...
I used the command cal -3 for this. But its throwing me a Bad Argument error.
I am using HP UX to execute this command. Is this a syntax error, or let me know if there any other ways to... (6 Replies)
Discussion started by: atlantis
6 Replies
6. Shell Programming and Scripting
I got this from this board yesterday
cal | xargs -n1 | tail -1 which displays the current months days.. for instance if you type this in a shell today you will get 31.
I would like to also display the month and year.. something like
March 2011 has 31 days.
how would I do that?
... (3 Replies)
Discussion started by: rontopia
3 Replies
7. UNIX for Dummies Questions & Answers
modify "cal " command to display calenders of the specified months.
$ cal jan....aug (1 Reply)
Discussion started by: ssaini
1 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a shell script that will:
"Display" the number of days in the current month. For example: September... (1 Reply)
Discussion started by: eaafuddy
1 Replies
9. Shell Programming and Scripting
Hi,
I want to make Monday as the first day of the month while using cal command
when I execute without bash, its working fine
/bin/sh
cal -m 03 2013
March 2013
Mo Tu We Th Fr Sa Su
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... (5 Replies)
Discussion started by: infyanurag
5 Replies
10. Shell Programming and Scripting
I was trying to get 1st Sunday in a month. I tried using cal followed by awk NF=1 apparently it would give entire 1st field in that month.
Any suggestions (11 Replies)
Discussion started by: penqueen
11 Replies
cal(1) General Commands Manual cal(1)
NAME
cal - print calendar
SYNOPSIS
[[month] year]
DESCRIPTION
prints a calendar for the specified year. If a month is also specified, a calendar just for that month is printed. If neither is speci-
fied, a calendar for the present month is printed. year can be between 1 and 9999. month is a decimal number between 1 and 12. The cal-
endar produced is a Gregorian calendar.
EXTERNAL INFLUENCES
For information about the UNIX Standard environment, see standards(5).
Environment Variables
determines the locale to use for the locale categories when both and the corresponding environment variable (beginning with do not specify
a locale. If is not set or is set to the empty string, a default of "C" (see lang(5)) is used.
determines the locale for interpretation of sequences of bytes of text data as characters (e.g., single- verses multibyte characters in
arguments and input files).
determines the format and contents of the calendar.
determines the timezone used to calculate the value of the current month.
If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See
environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
EXAMPLES
The command:
prints the calendar for September, 1850 on the screen as follows:
However, for UNIX Standard (see standards(5)), the output looks like below:
WARNINGS
The year is always considered to start in January even though this is historically naive.
Beware that refers to the early Christian era, not the 20th century.
SEE ALSO
standards(5).
STANDARDS CONFORMANCE
cal(1)