How do I update shell programs like crontab
for example?
On my Mac I've got version from 29th of December 1993, but on a server linux machine that I am using version of crontab is much better in terms of usability since it's from 19th of April 2010.
I am running MacOS Mojave and my bash version is :
GNU bash, version 5.0.2(1)-release (x86_64-apple-darwin18.2.0)
Best Answer
Where is the executable?
The result shows
/usr/sbin/cron
. System Integrity Protection (SIP) protects the contents of/usr
; thus we cannot affect a change anyway as long as SIP is enabled. You installed BASH via Homebrew, I take it. Searching Homebrew for cron-related formulae or casks reveals no candidates (brew search cron
), perhaps for reasons given by @nohillside. Perhapscron
was a bad example and a better example might bevim
. As you have discovered, one can utilize a package manager like Homebrew or Macports to install more recent software. For each installed package, Homebrew, at least, installs a symbolic link to wherever the executable was installed (/usr/local/Cellar/[...]
); thus, we could utilize a shell alias or modify thePATH
environment variable to utilize better versions of common software. I use the shell alias approach.For example, my shell is
zsh
, and I have installed MacVim. If the symbolic link for MacVim's version ofvim
exists (-h
), then define a new alias. Now, every time I executevim
, I am not executing thevim
located in/usr/bin
; rather, I am executing thevim
located in/usr/local/bin
. The below test and definition works the same for bash.And then use the package manager to update the software periodically.