LONG_NAME="Flintstone Fred"
SHORTNAME=Fred
Note in the first case that quotation marks are required because the string contains spaces. The backquote operator will execute the enclosed command and assign the output to the designated variable, e.g.,
LS_OUT=`ls`
When referring to the variable, its name must be preceded by $, e.g.,
X1=$Y2
You can declare numerical values too,
intA=5
Summary
- Declare string
- string1="string text"
- Declare command
- command1='ls'
- Declare numerical value
- intA=5
- floatB=.5
No comments:
Post a Comment