[bash/en] Improved descriptions

This commit is contained in:
ksami 2015-10-02 22:08:27 +08:00
parent 4a3d521430
commit acc9a73c01

View File

@ -51,7 +51,7 @@ echo $Variable
echo "$Variable" echo "$Variable"
echo '$Variable' echo '$Variable'
# When you use the variable itself — assign it, export it, or else — you write # When you use the variable itself — assign it, export it, or else — you write
# its name without $. If you want to use variable's value, you should use $. # its name without $. If you want to use the variable's value, you should use $.
# Note that ' (single quote) won't expand the variables! # Note that ' (single quote) won't expand the variables!
# String substitution in variables # String substitution in variables
@ -70,11 +70,11 @@ echo ${Foo:-"DefaultValueIfFooIsMissingOrEmpty"}
# Builtin variables: # Builtin variables:
# There are some useful builtin variables, like # There are some useful builtin variables, like
echo "Last program return value: $?" echo "Last program's return value: $?"
echo "Script's PID: $$" echo "Script's PID: $$"
echo "Number of arguments: $#" echo "Number of arguments passed to script: $#"
echo "Scripts arguments: $@" echo "All arguments passed to script: $@"
echo "Scripts arguments separated in different variables: $1 $2..." echo "Script's arguments separated into different variables: $1 $2..."
# Reading a value from input: # Reading a value from input:
echo "What's your name?" echo "What's your name?"
@ -108,8 +108,8 @@ fi
# Expressions are denoted with the following format: # Expressions are denoted with the following format:
echo $(( 10 + 5 )) echo $(( 10 + 5 ))
# Unlike other programming languages, bash is a shell — so it works in a context # Unlike other programming languages, bash is a shell so it works in the context
# of current directory. You can list files and directories in the current # of a current directory. You can list files and directories in the current
# directory with the ls command: # directory with the ls command:
ls ls