Bash

From Linuxintro
Revision as of 10:32, 21 March 2009 by imported>ThorstenStaerk (New page: Bash is the default [http://en.wikipedia.org/wiki/Shell_(computing) shell] in most Linuxes, for example in SUSE Linux. If you call it, you get a prompt like this: tweedleburg:~ # for a co...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Bash is the default shell in most Linuxes, for example in SUSE Linux. If you call it, you get a prompt like this:

tweedleburg:~ #

for a computer named tweedleburg. To start a program, just type its name and Enter, e.g.

tweedleburg:~ # firefox

To find out what shell you are in, echo the SHELL variable, like this:

tweedleburg:~ # echo $SHELL
/bin/bash

Programming

You can use your shell to execute little programs written in bash. For example, if you have a file myprogram containing the text

#!/bin/bash
echo "What is your name "
read name 
echo "Hello $name"

You can execute it and will be greeted by the name you give.