Alternatively, you can set the GNU date as follows:
- install Homebrew: https://brew.sh/
brew install coreutils- add to your bash_profile:
alias date="/usr/local/bin/gdate" date +%s 1547838127
The comments that the Mac should be βdifferentβ simply show that the commenter does not know the history of UNIX. macOS is based on BSD UNIX, which is much older than Linux. In fact, Linux was a copy of other UNIX systems, and Linux decided to become "different" by adopting GNU tools instead of BSD tools. GNU tools are more convenient for the user, but usually they are not found in any * BSD system (just like that).
Indeed, if you spend most of your time on Linux, but you have a Mac desktop, you probably want the Mac to work as Linux. It makes no sense to try to remember two different sets of parameters or scripts for the Mac Bash version of the BSD if you are not writing a utility that you want to run for both BSD shells and GNU / Linux.
Crossfit_and_Beer Jan 18 '19 at 19:05 2019-01-18 19:05
source share