search instagram arrow-down

Archives

Categories

Meta

Quotes

Quotes are really confusing and we don’t know where to use the correct one.
Here I try to describe it in very concise way.

”  Double quote:   (weak quote)
‘   Forward Tic  (strong quote)
`  Back Tic:  (Located on the left of the 1 key). command substitution.
\   Single character substitution
?  Match one character

daya@debian:~$ echo “This is my test on $HOSTNAME”
This is my test on debian

daya@debian:~$ echo “This is my test on \$HOSTNAME”
This is my test on $HOSTNAME

daya@debian:~$ variable1=`ls /home`
daya@debian:~$ echo $variable1—-> list the content of home directory.

daya@daya-laptop:~$ echo ‘This is my $HOSTNAME’
This is my $HOSTNAME

positional parameter:
$0 —> program name
$1 —> first argument
$2 —–>second argument


$9—–> 9th argument

$#—–> no. of arguments
$* ——> all arguments
$?—>return code

Leave a Reply
Your email address will not be published. Required fields are marked *

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: