Do Macs come with any programming language available from the Terminal?
I need to do a few little scripts on my Mac but I don't really want to install Xcode or Python for a full environment, just a quick command line deal. Does macOS come with anything suitable out of the box?
As an example I want to process files in a directory and do some custom logic.
Terminal runs the Unix shell, (bash, zsh, and others) which is obviously a command line scripting environment, which can execute complex scripts, particularly file processing.
Python 2.7 comes bundled with MacOS, and always has done. Future?.
Ruby, Perl are also included.
AppleScript and its JavaScript equivalent (docs) are also there out-of-the box.
You have good old bash (or csh, or whatever). You can use it to write shell scripts.
I'm on Mojave and Python, Ruby, and Perl are installed by default. But I understand that there is a Deprecation notice with Catalina that says future versions of macOS won't include scripting languages by default.
As suggested, as a clarification there are Unix shells in macOS, although in Catalina the default shell is zsh.
Testing on a 10.5.8, El Capitan and a Mojave computer - perl, ruby and python responded on the command line without providing any paths. Perl and ruby are in /usr/bin/ on each machine.
In addition to the languages already mentioned in other answers, macOS Mojave also comes with the general purpose programming language PHP, which is well suited to processing a number of files in a directory and performing custom logic.
In addition, macOS Mojave also comes with the programming languages awk and m4 that are specifically suited for processing text files in this manner.
If you're also looking at compiled languages, it is possible to use C, C++ and Objective-C from the command line without installing the whole XCode. You only need to install the Xcode Command Line Tools. In that same package you'll find the "swift" command that allows you to run scripts in the Swift programming language without having to compile them first.