|
Case Sensitivity
As you know Linux is case sensitive, the file names, variables, and arrays used in shell scripts are also case sensitive.
Check out this Example:
#!/bin/bash
string1=10
String1=20
echo "The value of string1 is $string1 "
echo "The value of String1 is $String1 "
Comments
Comments are used to escape from the code.
This part of the code will be ignored by the program interpreter.
Adding comments, make things easy for the programmer, while editing the code in future.
Example:
#!/bin/bash
string1=10 # Assigning value for string1
String1=20 # Assigning value for String2
# Now print the values
echo "The value of string1 is $string1 "
echo "The value of String1 is $String1 "
Escaping Characters
The escape character we use is the backslash ( \ ).
This is used to escape any type of character that might interfere with our code.
For example using the dollor sign.
#!/bin/bash
echo "The value of \$1 USD is \$1 CAD "
Try the same example without " \ ".
|