Hi folks,
I've been following a guide as part of my uni course that tells me to use the cal command in the terminal, however whenever I try to use cal I get the error message: -bash: cal: command not found.
I imagine there's maybe something obvious i'm missing but i'm brand new to this and no amount of googling helps.
Thanks!
-
- Posts: 5
- Joined: Sun Jan 16, 2022 1:29 pm
Re: Cal command not found
What does that command / program do?
Pls also tell us which OS + version you're using.
If possible also a link to your guide.
Pls also tell us which OS + version you're using.
If possible also a link to your guide.
Re: Cal command not found
Code: Select all
sudo apt install x11-apps
it displays a calendar in the terminal.What does that command / program do?
-
- Posts: 5
- Joined: Sun Jan 16, 2022 1:29 pm
Re: Cal command not found
Would you know the command for this or where I can find it ?
kerry_s wrote:Code: Select all
sudo apt install x11-apps
it displays a calendar in the terminal.What does that command / program do?
Thanks for the suggestion but that command didn't work. And yes it is a command to display a calendar - I'm using the latest release - cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
Re: Cal command not found
cal is part of the ncal package.
-
- Posts: 5
- Joined: Sun Jan 16, 2022 1:29 pm
Re: Cal command not found
It came as a surprise to me that ncal wasn't shipped as default, as there's so much historical software that calculates dates by calling cal in the background. The ncal manpage notes that:
HISTORY
A cal command appeared in Version 1 AT&T UNIX. The ncal command appeared in FreeBSD 2.2.6. The output of the cal command is supposed to be bit for bit compatible to the original Unix cal command, because its output is processed by other programs like CGI scripts, that should not be broken. Therefore it will always output 8 lines, even if only 7 contain data. This extra blank line also appears with the original cal command, at least on Solaris 8
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
-
- Posts: 2331
- Joined: Sat Nov 09, 2019 12:14 pm
Re: Cal command not found
Yeah, it is stone cold basic Unix. Impossible for it not to be there (and have whatever distro is running call itself Unix).It came as a surprise to me that [n]cal wasn't shipped as default...
Be nice to know what's really going on here...
Poster of inconvenient truths.
Back from a short, unplanned vacation. Did you miss me?
Back from a short, unplanned vacation. Did you miss me?
Re: Cal command not found
I didn't do an exhaustive check through all the images (32/64, with desktop and Lite), but looks like it was installed by default on Buster, but not on Bullseye.scruss wrote: ↑Sun Jan 16, 2022 4:56 pmIt came as a surprise to me that ncal wasn't shipped as default, as there's so much historical software that calculates dates by calling cal in the background. The ncal manpage notes that:
HISTORY
A cal command appeared in Version 1 AT&T UNIX. The ncal command appeared in FreeBSD 2.2.6. The output of the cal command is supposed to be bit for bit compatible to the original Unix cal command, because its output is processed by other programs like CGI scripts, that should not be broken. Therefore it will always output 8 lines, even if only 7 contain data. This extra blank line also appears with the original cal command, at least on Solaris 8
There doesn't appear to be a 'cal' package, just 'ncal', and cal is a link to ncal.
Amusingly, cal outputs the calendar in a reasonable format (for most people), while ncal rotates the whole calendar 90 degrees. What's with that? Oh, and 'ncal -C' outputs the calendar in 'cal format'.
Pi tools:
Quickly and easily build customized exactly as-you-want SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure IPSEC/IKEV2 VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo
Quickly and easily build customized exactly as-you-want SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure IPSEC/IKEV2 VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo
-
- Posts: 2331
- Joined: Sat Nov 09, 2019 12:14 pm
Re: Cal command not found
Then yet another reason to take a pass on "bullseye". Not having "cal" is just weird.it was installed by default on Buster, but not on Bullseye.
Incidentally, "cal" is just a symlink to "ncal", so it is probable that somehow, whoever put Bullseye together (either "upstream" or at RPF/RPT/whatever), just lost that symlink somewhere along the way.
So, all you need to do is:
Code: Select all
$ sudo bash
# cd /usr/bin
# ln -sv ncal cal
#
Poster of inconvenient truths.
Back from a short, unplanned vacation. Did you miss me?
Back from a short, unplanned vacation. Did you miss me?
Re: Cal command not found
It is because Debian no longer includes it in the base image. cal/ncal used to be part of bsdmainutils but that was split into separate packages like ncal. bsdmainutils was marked as important in Buster and older but is now optional in Bullseye. ncal has inherited the same.
Somebody else can dig into the reason why it isn't included by default in Bullseye.
"The cal utility displays a simple calendar in traditional format and ncal offers an alternative layout, more options and the date of Easter. The new format is a little cramped but it makes a year fit on a 25x80 terminal."
cal is actually ncal. It check its own filename and automatically adds the -C option if it is ran as "cal".
Re: Cal command not found
Indeed, I mentioned immediately above that "cal is a link to ncal".GlowInTheDark wrote: ↑Sun Jan 16, 2022 7:00 pmThen yet another reason to take a pass on "bullseye". Not having "cal" is just weird.it was installed by default on Buster, but not on Bullseye.
Incidentally, "cal" is just a symlink to "ncal", so it is probable that somehow, whoever put Bullseye together (either "upstream" or at RPF/RPT/whatever), just lost that symlink somewhere along the way.
So, all you need to do is:
Code: Select all
$ sudo bash # cd /usr/bin # ln -sv ncal cal #
Unless you've found a rogue case to the contrary, there's no need to symlink cal to ncal because it's already there.
Pi tools:
Quickly and easily build customized exactly as-you-want SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure IPSEC/IKEV2 VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo
Quickly and easily build customized exactly as-you-want SSDs/SD Cards: https://github.com/gitbls/sdm
Easily run and manage your network's DHCP/DNS servers on a Pi: https://github.com/gitbls/ndm
Easy and secure IPSEC/IKEV2 VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo
-
- Posts: 16179
- Joined: Fri Mar 09, 2012 7:36 pm
- Location: Vallejo, CA (US)
Re: Cal command not found
Son of a gun....you're right. I use cal from time to time and I'm used to it just being there. I just installed it on my one Bullseye system that is up and running. I'll have to add that to the list of What to Install on a new system.
I wonder why it wasn't included by default and what we can do to arrange that it is...
-
- Posts: 2331
- Joined: Sat Nov 09, 2019 12:14 pm
Re: Cal command not found
WHH says:
Anyway, and FWIW, the reason I included instructions for (re-) making the symlink is that someone mentioned "ncal" working but "cal" not. That suggests breakage, and I was trying to give instructions on how to fix it.
Obviously, if you install the package, then everything should be setup correctly and should be good-to-go.
Also, in response to: "Why it isn't default and if we can fix it so that it is", it sounds like the answer is "No" and "You'll just have to install it yourself". Like we all do with the many essential packages that aren't present in the base image.
Trejan says:I wonder why it wasn't included by default and what we can do to arrange that it is...
I think that explains it.It is because Debian no longer includes it in the base image. cal/ncal used to be part of bsdmainutils but that was split into separate packages like ncal. bsdmainutils was marked as important in Buster and older but is now optional in Bullseye. ncal has inherited the same.
Anyway, and FWIW, the reason I included instructions for (re-) making the symlink is that someone mentioned "ncal" working but "cal" not. That suggests breakage, and I was trying to give instructions on how to fix it.
Obviously, if you install the package, then everything should be setup correctly and should be good-to-go.
Also, in response to: "Why it isn't default and if we can fix it so that it is", it sounds like the answer is "No" and "You'll just have to install it yourself". Like we all do with the many essential packages that aren't present in the base image.
Poster of inconvenient truths.
Back from a short, unplanned vacation. Did you miss me?
Back from a short, unplanned vacation. Did you miss me?
-
- Posts: 16179
- Joined: Fri Mar 09, 2012 7:36 pm
- Location: Vallejo, CA (US)
Re: Cal command not found
I would class cal as a rather more basic function than the packages I add to any new install, they being putty, units, mplayer, gparted, and fortune. If someone fairly young is likely to use the system, I add tuxpaint and tuxmath to the list. I really don't expect anything on that list to part of the default image. "cal" on the other hand...GlowInTheDark wrote: ↑Sun Jan 16, 2022 11:18 pmAlso, in response to: "Why it isn't default and if we can fix it so that it is", it sounds like the answer is "No" and "You'll just have to install it yourself". Like we all do with the many essential packages that aren't present in the base image.
Re: Cal command not found
I missed it when writing a script to make this:
A new old calendar in a variety of formats)
(which, if you must, you can find here ‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
Re: Cal command not found
Even that is not the whole story.
In other distros "cal" is provided by util-linux. util-linux is marked as an essential package in Debian. However, perhaps because Debian is theoretically multi-kernel, they disdain util-linux and do not allow it to provide any binaries that they can live without.
So in Debian, you can have the "cal" from BSD, or the one from Plan9 (package 9base; binary installs into /usr/lib/plan9/bin/), but never the one from util-linux.
During buster, someone reported an issue that the "rename" command from util-linux could not be made the default, like it is in other distros. Debian was installing it as "rename.ul" so they could continue to provide a janky Perl script as rename. So in bullseye, even rename.ul is gone. Used that? Tough.
Perhaps weirdest of all, the version of "write" from util-linux, which is the standard version in other distros, Debian not only calls "write.ul" but also places in the package bsdextrautils.
Because of the "rename" issue, I compile util-linux from source into /usr/local/bin/ on Debian systems.
-
- Posts: 2331
- Joined: Sat Nov 09, 2019 12:14 pm
Re: Cal command not found
Just to be clear, we are in total agreement here about cal being obligatory. As I mentioned upthread, cal is (IMHO) stone cold basic Unix. To remove it is insanity.I would class cal as a rather more basic function than the packages I add to any new install, they being putty, units, mplayer, gparted, and fortune. If someone fairly young is likely to use the system, I add tuxpaint and tuxmath to the list. I really don't expect anything on that list to part of the default image. "cal" on the other hand...
This just seems to be yet another instance in which "Bullseye" has missed the target (with pun intended).
Poster of inconvenient truths.
Back from a short, unplanned vacation. Did you miss me?
Back from a short, unplanned vacation. Did you miss me?
Re: Cal command not found
excuse me, but that script you decry as 'janky' has been in constant development and careful maintenance since 1992. It's pretty much perfect, and is a must-have
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him
Pronouns: he/him
-
- Posts: 2331
- Joined: Sat Nov 09, 2019 12:14 pm
Re: Cal command not found
In the category of "One man's meat is another main's poison"...
One man's "must have" is another man's "Oh, god, not this!!!"excuse me, but that script you decry as 'janky' has been in constant development and careful maintenance since 1992. It's pretty much perfect, and is a must-have... so they could continue to provide a janky Perl script as rename.
Poster of inconvenient truths.
Back from a short, unplanned vacation. Did you miss me?
Back from a short, unplanned vacation. Did you miss me?