retagged by
1,430 views
1 votes
1 votes

Which of the following set of Unix commands will always display “WELCOME”?

  1. export title =WELCOME; Echo $\$$title
  2. title =WELCOME; export $\$$title ; sh –c “echo $\$$title”
  3. title =WELCOME; export title ; sh –c “echo $\$$title”
  4. title =WELCOME; echo $\$$title
retagged by

1 Answer

1 votes
1 votes

ans should be C

by default any variable is available only in the shell in which it is defined. if we want variables to be  available to all sub shells we mst export them from the current shell  by command

$ export variable_name 

the proper syntax of using export variable to obtain a list of ALL exported variable  is simply say export at shell prompt  $ export

so here first $ title=WELCOME Then $ export title and finally sh –c “echo $$title”

Answer:

Related questions

1 votes
1 votes
1 answer
2
go_editor asked Jul 20, 2016
4,061 views
Find the number of ways to paint 12 offices so that 3 of them will be green, 2 of them pink, 2 of them yellow and the rest ones white.55,4401,66,3204.790E+0839,91,680
1 votes
1 votes
1 answer
3
go_editor asked Jul 20, 2016
2,492 views
Which of the following substitution technique have the relationship between a character in the plaintext and a character in the ciphertext as one-to-many?MonoalphabeticPo...
3 votes
3 votes
1 answer
4
go_editor asked Jul 22, 2016
4,152 views
Which of the following is not a part of an expert system shell?Knowledge baseInterference engineExplanation facilityNone of the above