Difference between revisions of "Shell scripting tutorial"

From Linuxintro
imported>ThorstenStaerk
Line 11: Line 11:
 
Note that the variable is called $name, however the correct statement to read it is  
 
Note that the variable is called $name, however the correct statement to read it is  
 
  read name
 
  read name
 +
 +
= conditions =
 +
echo "what is your name? "
 +
read name
 +
if [ $name = "Thorsten" ]; then echo "I know you"
  
 
= See also =
 
= See also =

Revision as of 00:04, 2 January 2012

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