(Difference between pages)
imported>ThorstenStaerk |
imported>ThorstenStaerk |
Line 1: |
Line 1: |
− | = Hello world =
| + | #REDIRECT [[Piping]] |
− | 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
| |
− | It is a common mistake to write
| |
− | read $name
| |
− | which means "read a string and store it into the variable whose name is stored in $name"
| |
− | | |
− | = conditions =
| |
− | echo "what is your name? "
| |
− | read name
| |
− | if [ $name = "Thorsten" ]; then echo "I know you"
| |
− | | |
− | = See also =
| |
− | * [[bash]]
| |
− | * [[shell]]
| |
− | * [[scripting]]
| |
− | * [[bash Operators]]
| |
− | * http://en.wikibooks.org/wiki/Bash_Shell_Scripting
| |
− | * http://wiki.linuxquestions.org/wiki/Bash_tips
| |
− | * http://wiki.linuxquestions.org/wiki/Bash
| |
Latest revision as of 09:14, 10 January 2013