Answers

Question and Answer:

  Home  Linux Shell

⟩ What is the output of this program? #!/bin/bash san_var="google" echo "$san_var" echo '$san_var' echo '"$san_var"' echo "'$san_var'" echo $san_var exit 0 a) google $san_var "$san_var" 'google' $san_var b) google google "google" 'google' google c) program will generate an error message d) program will print nothing

a) google

$san_var

"$san_var"

'google'

$san_var

Explanation:

Using double quotes does not affect the substitution of the variable, while single quotes and backslash do.

Output:

root@ubuntu:/home/google# ./test.sh

google

$san_var

"$san_var"

'google'

$san_var

root@ubuntu:/home/google#

 142 views

More Questions for you: