LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-16-2020, 07:31 AM   #1
blueray
Member
 
Registered: Feb 2020
Location: Bangladesh
Distribution: Debian, Ubuntu, Linux Mint
Posts: 65

Rep: Reputation: 0
Why Bash, ZSH etc are combo of both Command Interpreter & Command Language


I have been thinking about this for a long time now. This has become a brainworm. I have to ask this question to get it out of my system.

The Linux philosophy is to make each program do one thing well. The Linux shell seems to have started with this philosophy. I checked the manual of Thompson Shell. It did precisely what it was supposed to do (maybe a little thing here and there).

But then came Mashey shell, Bourne shell, C shell, Korn shell, Bash, ZSH, Powershell etc. Which integrated a Command Language with the Command interpreter.

So, what was the real issue? Why we can't use a minimal Command interpreter(Something like Thompson Shell) with the language we prefer (maybe something like abs-lang). Why do we need to package Command interpreter & Command Language together?
 
Old 05-16-2020, 08:31 AM   #2
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
Originally Posted by blueray View Post
So, what was the real issue? Why we can't use a minimal Command interpreter(Something like Thompson Shell) with the language we prefer (maybe something like abs-lang). Why do we need to package Command interpreter & Command Language together?
Because otherwise Unix (this was way before Linux) would have to ship a separate JCL (Job Control Language) application to automate tasks (like old-fashioned O/S'es, say IBM OS/360 and its successors, already did). Even something simple like MS-Dos' COMMAND.COM interpreter already includes a (limited) programmabity with IF, GOTO and labels, which they called "batch processing" (.bat files).

And in a standard Linux you will be surprised how many often used "commands" are actually shell scripts. That would never have been possible without the evolution to Bourne and Korn shell (that both precede the creation of Linux, as actually bash does).
 
2 members found this post helpful.
Old 05-16-2020, 10:40 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 14,533
Blog Entries: 9

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
Quote:
Originally Posted by blueray View Post
The Linux philosophy is to make each program do one thing well.
Actually it goes "The UNIX philosophy is... etc."
A beautiful statement, a good "philosophy" to remember, yes.
But much overquoted, much overused and abused to criticize anything a Luddite does not fancy.
I wonder how many of the original UNIX utilities, or in fact the OS itself, don't fully adhere to this "philosophy".

Quote:
Originally Posted by blueray View Post
I checked the manual of Thompson Shell. It did precisely what it was supposed to do (maybe a little thing here and there).
But it says right there:
Quote:
It is the program which reads and arranges the execution of the command lines typed by most users. It may itself be called as a command to interpret files of commands.
Which is exactly the kind of "do more than 1 thing" you seem to oppose. Since 1973.
 
Old 05-16-2020, 02:48 PM   #4
blueray
Member
 
Registered: Feb 2020
Location: Bangladesh
Distribution: Debian, Ubuntu, Linux Mint
Posts: 65

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ondoho View Post
Which is exactly the kind of "do more than 1 thing" you seem to oppose. Since 1973.
This is why I was hesitating to ask this question. No sir, I do not oppose anything.

I just wanted to know the technical reason behind packaging Command Interpreter & Command Language together? I wanted to know why they can't be separated.

Last edited by blueray; 05-16-2020 at 02:49 PM.
 
Old 05-17-2020, 01:39 AM   #5
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,392

Rep: Reputation: 624Reputation: 624Reputation: 624Reputation: 624Reputation: 624Reputation: 624
I often use a loop on the command line, for ex
Code:
for h in server{01,{08..12},15}
do echo $h; ssh $h "
uname -a
df -h /var
" ; done
With "cursor up" I can edit this, and rerun it on other servers and/or with changed remote commands.

Last edited by MadeInGermany; 05-17-2020 at 01:42 AM.
 
Old 05-17-2020, 01:50 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 14,533
Blog Entries: 9

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
Quote:
Originally Posted by blueray View Post
I just wanted to know the technical reason behind packaging Command Interpreter & Command Language together?
Because it's the same thing essentially.

You're talking history; I think you fail to see there was a different mindset around computers in the sixties; the shell did exactly what ws most required and desired at that time, I'm sure.

The Thompson shell article states:
Quote:
The name "shell" for a command-line interpreter and the concept of making the shell a user program outside of the operating system kernel were introduced in Unix's precursor Multics.
The Multics article:
Quote:
Ken Thompson, in a transcribed 2007 interview with Peter Seibel[24] refers to Multics as "overdesigned and overbuilt and over everything. It was close to unusable. They [Massachusetts Institute of Technology] still claim it's a monstrous success, but it just clearly wasn't". On the influence of Multics on Unix, Thompson stated that "the things that I liked enough (about Multics) to actually take were the hierarchical file system and the shell a separate process that you can replace with some other process".
I can see why he liked it. It makes the command line so versatile and powerful.

Now I leave you to do your own wikipeding.

BTW, I understand the question and the curiosity - there just doesn't seem to be a clear reason for it other than usability and convenience.
Many things we do on computers are not dictated by some technical constraints but by - well, tradition. Tried & tested & found to be Good.
 
1 members found this post helpful.
Old 05-17-2020, 03:00 AM   #7
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 4,777

Rep: Reputation: 1417Reputation: 1417Reputation: 1417Reputation: 1417Reputation: 1417Reputation: 1417Reputation: 1417Reputation: 1417Reputation: 1417Reputation: 1417
I know the thread is marked as solved. But I still want to comment.
Quote:
Originally Posted by blueray View Post
I just wanted to know the technical reason behind packaging Command Interpreter & Command Language together? I wanted to know why they can't be separated.
There is no technical reason. They can be separated. It's convenient to keep them together.
 
1 members found this post helpful.
Old 05-17-2020, 04:30 AM   #8
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
Originally Posted by blueray View Post
I just wanted to know the technical reason behind packaging Command Interpreter & Command Language together? I wanted to know why they can't be separated.
They can, but they do have a lot in common: just like a CLI (Command Line Interpreter) a JCL has to execute external commands (applications), mostly IN sequence, so just like a series of commands you type in. But while in a CLI you look at possible error messages that is less practicable in a JCL, so you test for exit codes instead and there you got your first IF in the langauge (like the IF ERRORLEVEL in MS-Dos batch processing).
 
  


Reply

Tags
discussion, shell


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ZSH -- Apple switching BASH => ZSH, what do you think? LQParsons Linux - Newbie 2 06-06-2019 10:01 AM
bash dash zsh sh and co | crontab | why so complicated taumeister Linux - General 13 04-19-2018 10:05 AM
LXer: How to Setup ZSH and Oh-my-zsh on Linux LXer Syndicated Linux News 0 11-02-2017 12:42 AM
Combo,combo box and combo entry box diff santhosh.linux Programming 4 02-27-2006 12:37 AM
Gotta love those ٱٱٱٱٱٱٱ&# iLLuSionZ Linux - General 5 11-18-2003 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration