Questions tagged [cal]

cal is a command line application which displays an ASCII calendar along with the current date.

Filter by
Sorted by
Tagged with
-1
votes
1answer
42 views

How do `cal` options work?

cal doesn't work with any options. cal -M returns Usage: cal [general options] [-jy] [[month] year] cal [general options] [-j] [-m month] [year] ncal -C [general options] [-jy] [[month] ...
0
votes
1answer
49 views

Launching urxvt with calendar (cal) using sxhkd

Hi I'm trying to launch cal with sxhkd. And it doesn't work, the terminal window is closed right after the command is executed. I tried to do it using the following: # launch urxvt 20x8 with cal super ...
3
votes
1answer
65 views

Why does `ncal -p` say that “Latin” switched from Julian to Gregorian calendar on 9999-05-31?

I ran ncal -p to print the switching days from the Julian to the Gregorian Calendar, and I see this: AL Albania 1912-11-30 IT Italy 1582-10-04 AT Austria 1583-10-05 ...
1
vote
1answer
104 views

How to out the output of the command 'cal' to csv.?

How can I format the output of the command cal -y 2020 as a csv? I want to prepare the calendar in a table processor. Can this be done? I am using Slackware 14.2.
0
votes
2answers
358 views

Pick off 'first' dates using cal function in bash

I'm trying to pick off the first Monday, second Tuesday, second Saturday, etc. out of the cal function and piping awk commands. For this month, I can get the first Tuesday correctly with the command ...
-5
votes
2answers
710 views

One liner required to get last working day for previous month [closed]

E.g. today is 06/04/2018; the desired output is 05/31/2018. For 07/01/2018 the output should be 06/29/2018.
-1
votes
4answers
123 views

How can get the list of all Saturdays in a given date range ex: 20170101 to 20170630 in YYYYMMDD format in linux?

I need to get the list of all Saturdays in a given date range ex: 20170101 to 20170630 in YYYYMMDD format in linux
5
votes
2answers
192 views

Is it possible to allow a background process to continuously output to terminal?

Here's a use-case to clarify my question. Say I have a calendar program that is set to run in ~/.bashrc, and it ensures the streaming output overwrites the same block of lines. Is it possible to have ...
7
votes
4answers
2k views

Output current day using cal

I'm asked to output the current day using the cal command. So far, I discovered that before the current date there is a _ symbol. I decided to use grep here: cal | grep '\b_*', but it outputs the ...
-2
votes
2answers
446 views

Calendar to Cal displaying schedule [closed]

I don't understand how to create a txt to use the calendar utility to display "notes"
0
votes
1answer
80 views

Why is that `ncal -CM` doesn't work but `ncal -MC` does?

I wanted to put a calendar in a file so I ran: $ ncal -CMh > file.txt But instead I received the following: Usage: cal [general options] [-hjy] [[month] year] cal [general options] [-hj] [...
3
votes
2answers
510 views

Why does 'cal' use weird 08 / ^H / \b terminal code for highlighting and how does that work?

When you run cal on Linux, the output for the current month will reverse video highlight the current day. When I send that output to hexdump -c, I get some interesting results: 0000000 ...
0
votes
2answers
602 views

How to display each day of a month on a separate line using tr, sed and cal

How to use commands, cal, sed and tr and the pipe to display the numerical days (e.g., 1, 2, 3, etc.) of a month, with each day on a separate line I've tried: cal 12 2015| sed '3,7p' | tr -cs "[:...
2
votes
1answer
126 views

Zeller's congruence and cal command

According to Zeller's Congruence, the day of 29 Feb, 1600 is Tuesday. However, the cal command shows it as Friday.Is there a bug in cal's code or a limit on the range of years which Zeller's ...
5
votes
2answers
1k views

How can I make the `cal` tool in OSX highlight the current day?

In Ubuntu and Fedora, when I type cal on the command line I get an ASCII calendar with the current day highlighted. In OSX, when I type cal, I get an ASCII calendar but no day is highlighted. How ...
0
votes
3answers
3k views

How to Print the calendar for March and April 2015 and show the calendar entries side-by-side? using UNIX

how to Print the calendar for March and April 2015 and show the calendar entries side-by-side? in UNIX
4
votes
2answers
2k views

Multi-month view in calendar (cal) in OS X

I am hoping to run some of the commands listed in this article, e.g.: cal -3 which is supposed to show me the last month, this month, and next month. This command does not work in OS X. $ cal -3 ...
2
votes
1answer
460 views

calendar to check the date and then search 3 months back and add up the days of those months

I want to use the cal command or the date command to display the current day, then I want it to display 3 months before the current date, then add up all the days in those 3 months up to the current ...
6
votes
1answer
3k views

How to emphasize holidays by color in `cal` command

I want to emphasize holidays by color in cal or similar command. I'm using OS X and Ubuntu 14, is there easy way to enable the function?
3
votes
3answers
3k views

bash script that reads user input and uses “cal” command to validate dates

I want to write a script that reads my input (for example if my script is called "check", then I would type "check 9 4 1993" and that input would go through the cal command and will check through the ...
0
votes
1answer
147 views

how to write this if command?

my script name is 1. when i type in "1 2012 12 12". it shows current date calendar and when i enter a invaild date like "1 2323232" cal gives me a error so how could i put that in if loop that if it ...
3
votes
2answers
648 views

Highlight today in Mac's cal

Every Mac comes with cal which shows a simple calendar of current month. Output is something like this: February 2014 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 ...
1
vote
1answer
439 views

Julian calendar for a UK locale in ncal

On my machine, ncal identifies my country code as GB, and use that to find the date for the shift to the gregorian calendar, and I think cal uses the same date by default: cal: $ cal 09 1752 ...
3
votes
2answers
2k views

How to make FreeBSD variant of cal start weeks on mondays?

Can week start day be changed in cal output? Is it hardcoded? Notice: not the ncal.
3
votes
1answer
281 views

Cal no space delimiter

I am an OpenBSD user and I am writing an awk script which automatically generates TeX course calendars for all courses that I teach. To obtain actual calendar out of the system I use Unix cal command. ...
29
votes
2answers
27k views

Is `cal` broken? What happened in September 1752?

If you look at the output of cal 9 1752 you will see this strange output: September 1752 S M Tu W Th F S 1 2 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 The following story ...
6
votes
6answers
6k views

Highlight the current date in cal

I would like to highlight today's date in the output of the cal command. What is the best way? This is what I have so far: cal -m | grep -C6 --color "$(date +%e)" but it doesn't work for all cases ...