Thursday, September 13, 2012

3 ways to assign a variable into a variable

بسم الله

أنا أحب اللغة بَشْ
I love the BASH language

The following are 3 ways to assign a variable into another variable in BASH بَشْ

VAR1=`echo $VAR2`

VAR1=$(echo $VAR2)

VAR1="$2"

In my personal view, the third method is the most handsome! Please take note that there is no space in between the = sign

No comments:

Post a Comment