My two cents
Comming on this SO question something late, reading fedorqui's answer, I think "programming language" is not exactly same thing than "command language", meaning a language intented to run commands.
About turing consideration, yes, you could... I personally wrote a lot of libraries around bash (around monitoring, backups, sysadmin, networking, etc.), but clearly for writting a program,
you have to use a real programming language.
However
bash is a shell (like sh and others shell)! Meaning an overall aggregator language, or a super language.
First goal is to be an interactive command processor,
in order to use and maintain posix systems.
One of his firsts applications was to create wrappers in order to prepare environment for running programs written in other languages.
So this command proccessor is
ideal for systems, filesystems, networks and a lot of administation tasks, because
it's interactive and using his history make creating script job just easy.
His real power
As this language is intended to deal with ios, forks, fifos and because posix said everything is a file, a shell script could normally deal with everything, directly or by using others tools/binaries/application. This language is intented to
create condition, execution groups and interaction around everything.
This could open a lot of interactivity between systems, networks, iot, etc...
A script could for sample (see further my shell connector demo).
1. Open DB, SSH connection and log file simultaneously as file descriptors.
2. Create SQL (temporary or not) table
3. Doing loop, checking for event on DB, SSH connection or else...
4. Interact with DB and/or SSH...
5. Close all file descriptors (DB, SSH, log file, etc)
Mandelbrot sample:
Comments on Mecki's anwers show a good sample of how bash could be used to deal with other binaries (bc for Mandelbrot)...
Where shell is used to run bc and aggregate his answers.
- If script do one fork for each calcul, this script will take many hours to draw a Mandelbrot on 80 columns terminal.
- 1st improvement: running only one background fork to
bc -l to submit all calculs, drop down execution time to 8 minutes.
- 2nd improvement: passing iterate loop (upto 2000 tests) to
bc, drop
own execution time to 8 secondes.
- 3nd improvement: creating more background
bc for computing many dot simultaneously (parallel-processing), in order to use multi-core, dividing execution time approximatively by available cores... (Thanks to Léa Gris for contributing, helping making this posix compatible, multi-core idea and adding colors, making this near beautiful, I can't resist to post his result)
![Colored Mandelbrot in terminal]()
More sample
I wrote some scripts showing this powerfull parallelisation capabilities:
- multiping.sh will run many
ping simultaneously and draw a dynamic graphic using gnuplot, while staying interactive.
- shell_connector.sh is a library if sourced but contain a full demo using
sqlite, date and bc as background co-process if run.
- getSo.sh is a script intented to connect on SO server, by using openssl with authentication, cookies and Connection: keep-alive.
In order to do some monitoring, checks against differences or so one, we could create a script to open many simultaneous connections
to many differents targets, using one of netcat, sql-client, ftp, open-ssl s_client, ssh or else...
... with the ability of running sha1sum, grep, xmlint or bc (if not already backgrounded) when required, while connections stays open...
Conclusion
shell is a super-language, useful to aggregate a complex application using many programs in various languages.