Shell scripting tutorial

From Linuxintro
Revision as of 00:07, 2 January 2012 by imported>ThorstenStaerk (→‎See also)

Hello world

echo "hello world"
#!/bin/bash
echo "hello world"

input

echo "what is your name? "
read name
echo "hello $name"

Note that the variable is called $name, however the correct statement to read it is

read name

conditions

echo "what is your name? "
read name
if [ $name = "Thorsten" ]; then echo "I know you"

See also