5 ms·
They've actually been warning users since Catalina (if not longer) when the following are run: python irb php --version tclsh For PHP, it also shows up in
by jcfields 5y ago
They've actually been warning users since Catalina (if not longer) when the following are run:
python
irb
php --version
tclsh
For PHP, it also shows up in Apache's server string:
Apache/2.4.46 (Unix) PHP/7.3.24-(to be removed in future macOS) mod_perl/2.0.9 Perl/v5.30.2 on hostname
Personally, I've been hoping they'd do this for a while since it's annoying having two versions of each interpreter installed (the system one that can't be updated and the one I installed myself via Mac Ports). Anyone who uses these languages much probably already has a package manager installed. I think they should leave Perl, though, since it's as much as Unix system utility like awk or sed as a programming language.
- rbanffy 5y agoI find the MacPorts approach to be very developer friendly and I wouldn’t really want to use a “naked” macOS install as my work machine. MacPorts makes it look like a very credible BSD workstation. I really have no issue with Apple trimming down the surface of the OS to a minimum.
- mrsuprawsm 5y agoWhile the warning shows for python2, it doesn't show for python3, implying that it's here to stay for now: % /usr/bin/python WARNING: Python 2.7 is not recommended. This version is included in macOS for compatibility with legacy software. Future versions of macOS will not include Python 2.7. Instead, it is recommended that you transition to using 'python3' from within Terminal. Python 2.7.16 (default, Mar 25 2021, 03:11:28) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin Type "help", "copyright", "credits" or "license" for more information. >>> % /usr/bin/python3 Python 3.8.2 (default, Dec 21 2020, 15:06:04) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>
- deleted 5y ago[deleted]
- _wldu 5y agoPython is to Unix/Linux/Mac what PowerShell is to Windows. It's here to stay.
- jbverschoor 5y agoNo it’s not. And it won’t
- cortesoft 5y agoI am pretty sure bash is the powershell of Unix/Linux/Mac
- syshum 5y agobash is more akin to cmd/batch then Powershell. there is a TON more you can do with powershell than you can with bash. Plus object pipelines are superior to text pipelines You can also install Powershell on Linux. So I would say Powershell is the Powershell of Linux
- mishac 5y agoyou can install bash on windows too.
- flukus 5y agoI don't think powershell is even the powershell of windows. You get some of the better sysadmins using it, but working in the c#/windows world I see developers rarely touching powershell, certainly nowhere near as often as you'll see Linux develops writing a shell script. I wouldn't be surprised if C# was more used for "scripting" purposes than powershell, it usually ends up shorter and more readable anyway.
- suprfsat 5y agoThat's because it's not part of the base OS: % /usr/bin/python3 xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
- Wowfunhappy 5y agoNote how despite not coming with the OS, `python3` is still placed in the Apple-only `/usr/bin/` directory. And a binary exists at that path either way, it's just a stub by default. Because none of this is confusing at all. I don't like how Apple handles this. If you have the developer tools installed, it's not especially obvious what is part of those tools and what is actually bundled with the OS. And so it's not surprising that some scripts I've come across will silently break in semi-odd ways without the dev tools. Also, why is Python a developer tool, but Perl isn't? Or ZSH, for that matter? Does the distinction actually make any sense?
- kbenson 5y ago> Note how despite not coming with the OS, `python3` is still placed in the Apple-only `/usr/bin/` directory. And a binary exists at that path either way, it's just a stub by default. Because none of this is confusing at all. There's long been problems with this on UNIX systems. For a long time there's generally been three categories of software to track (OS provided, third party managed, manually compiled/installed), and two different locations to put them (/usr, /usr/local. / is different and has/had other constrains and reasons behind usage). OS provided packages go into /usr, stuff a user manually compiles and installs goes into /usr/local, but where does a third party package manager put stuff? It's not OS provided, but it is packages and maintained, so /usr seems valid. At the same time, it's user installed, so /usr/local seems valid. Both make the other used of those locations more complicated to reason about. > Also, why is Python a developer tool, but Perl isn't? Or ZSH, for that matter? Does the distinction actually make any sense? Possibly because some are used by the OS to actually do things for the OS (not sure if Apple finally got rid most those dependencies or not). The problem of the OS shipping a component for it's own needs that gets used by others is a decades old problem at this point. It's complicated because if it's available users to use, they'll use it, and when the OS wants to update or change it in some way it can break user assumptions. If users update it system wide, they can break OS assumptions.
- salmo 5y agoTotally agree. I think anyone developing with these tools would too. It's not as annoying as say, RedHat, but out of date "system" versions are just obnoxious. I don't know if any "native" apps have leveraged them, though. That would be the real risk of disruption. Also, as someone who never uses PHP, I'd really rather not have it on my machine. Scripting languages are a pretty big attack surface, even if it's just to pivot after initial compromise. I'd rather not have one there that's not being used.
- salmo 5y agoI'll also make the inflammatory statement that people should just use sed and awk in shell scripts and leave Perl for when they really want to write Perl. It is weird to me the number of times 90's Linux Distros used Perl for things that are easy in awk, awk for things that are easy with cut, and other commands for things that are easy with POSIX shell baked-in facilities. I guess I'm just a shell snob.
- efaref 5y agocut usually doesn't do what you want it to do. Most of the time you want to split on sequences of whitespace (which may or may not be tabs, it's not easy to tell from the output of the program). cut doesn't let you do this, which is a shame, as it would've been a sensible default. It also does weird things like print out the whole row if there's no instance of the separator on the line. So because you can't trust cut to do what you want, you'll probably reach for something like awk '{print $3}' instead.
- squiggleblaz 5y agoYeah, after I remembered that `cut` exists shortly before needing to grab some fields of an input, I thought "oh, I'll use `cut` instead of `awk`". And lo and behold, `cut` couldn't do the thing I wanted. Why learn two tools when one will do? The only reason I can think of is the principle of least privilege, but if you can convince me it applies, I'll convince you should write a single tool that adheres to it instead of using countless tools for any given transform/privilege pair.
- unknown_error 5y ago> since it's as much as Unix system utility like awk or sed as a programming language. Even those tools suffer from Apple's lack of fucks given. I often have to replace included system commands with the homebrew equivalent because Apple's is missing some common functionality. I wish Apple would just adopt homebrew as a firstparty package manager.
- brigandish 5y agoI'd plump for Macports or pkgsrc long before Homebrew.
- zodiakzz 5y agoHomebrew should first come up with basic functionality... like you know not assuming the OS will only have one user account ever. I was quite shocked when I found this out about the oh so amazing package manager. Before someone shares some bizarre workaround: no thanks.
- brigandish 5y agoThe last time I bothered with it, it complained about my use of `sudo` but wouldn't run unless I was logged in as admin - not a temporary bump, just logged in as an admin. Sudo isn't alright but running as admin is…? I really can't work that one out. It also broke so I uninstalled it. When I need to I go straight to their formulas and install by hand, as a non-admin user.
- smoldesu 5y agoThe issue (in my experience) is that neither Homebrew nor Macports provide a "full fat" package management experience like pacman or even apt. Not only are they missing packages, they're missing features and are loaded with outdated builds. If Apple made a first-party package manager that didn't suck, I'd probably have a Mac on my desk today.
- donarb 5y agoHomebrew is a piece of crap. There's no away to install specific versions of software (unless you dig through the git repo and install using a commit hash). It has a scorched earth policy of wiping out dependencies willy nilly. One time I installed Python 3.8 and it wiped out the version of openssl used with Python 3.7 I used for a client project.