Shell

Shell

January 6, 2023 | permanent

Summary #

tags :

In computing, a shell is a computer program that exposes an ’s services to a human user or other programs.

In general, operating system shells use either a command-line interface () or graphical user interface (GUI), depending on a computer’s role and particular operation.

It is named a shell because it is the outermost layer around the operating system.

Command language to interact with OS

wikipedia

Simply put, the shell is a program that takes commands from the keyboard and gives them to the operating system to perform. In the old days, it was the only user interface available on a system such as Linux. Nowadays, we have graphical user interfaces (GUIs) in addition to command line interfaces (CLIs) such as the shell. ref

Bourne shell #

The Bourne shell (sh) is a shell command-line interpreter for computer operating systems.

The Bourne shell was the default shell for Version 7 Unix. Unix-like systems continue to have /bin/sh , Linux —which will be the Bourne shell, or a symbolic link or hard link to a compatible shell—even when other shells are used by most users.

command language interpreter that executes commands read from the standard input or from a file. wikipedia

Bourne Again Shell #

  • Bourne again shell (Bash, sh compatible) is a free Unix shell that can be used in place of the Bourne shell.

  • It is a complete implementation of the Portable Operating System Interface for Unix () and Open Group shell specification.

  • Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh).

Details #

Bash is basically a command processor that typically runs in a text window, allowing the user to type commands that cause actions. It can read commands from a file, called a script. Like all Unix shells it supports the following:

  1. File name wildcarding
  2. Piping
  3. Hear documents
  4. Command execution
  5. Variables and control structures for condition testing and iteration

$ in Bash #

The syntax is token-level, so the meaning of the dollar sign depends on the token it’s in.

stackoverflow

$var-name #

var=1
echo $var

$(command) in Bash #

The expression $(command) is a modern synonym for `command` which stands for command substitution;

it means run command and put its output here

echo "Today is $(date). A fine day."


Go to random page

Previous Next