You are on page 1of 1

-> The UNIX shell program interpret user commands, which are directly entered by

the user, or which can be read from a file called the shell script
or shell program.
-> Shell scripts are interpreted, not compiled.

* Interpreted Vs Compiled:
Every program is a set of instructions, whether it’s to add two numbers or send a
request over the internet. Compilers and interpreters take human-readable code and
convert it to computer-readable machine code.
In a compiled language, the target machine directly translates the program. In an
interpreted language, the source code is not directly translated by the target
machine. Instead, a different program, aka the interpreter, reads and executes the
code.
At a high level, the difference between a compiled and interpreted language is
that an interpreted language is compiled into an intermediary form and not machine
code.
The code written in a compiled language is converted directly into machine code
that is specific to the targeted runtime architecture. Interpreted code is compiled
into an intermediary that runs on any architecture.

* What is a shell?
A shell provides an interface to the UNIX system. It gathers input and executes
programs based on the input. When program finishes executing, it
displays that program's output.
Shell is an environment in which we can run commands, programs and shell scripts.

Platform agnostic: It can run anywhere


caveat: Conditions or Limitations / a warning or caution

Commands:
--------
cat /etc/shells - To check the types of shells
cat /etc/passwd - To check the default shell
touch filename - To create a file
echo - To print something on the terminal
-p : To read the given identifier name
-s : To keep the entered identifier values silent
-e with \n : To print in the next line

Shell Programs:
--------------
Basic Program: name.sh

#!/bin/bash
echo "This is my first shell program"
pwd

variable.sh
-----------
#!/bin/bash
echo $BASH
echo $BASH_VERSION
name='Satyachandra Taninki'
echo My name is: $name
age=30
echo My age is: $age

You might also like