Giventhefollowingscript,whydoestheoutputcomeoutasanemptylineinsteadof"dog"()!/bin/ksh$VAR=dogecho"${VAR}"A.The$VARvariablewasnotexported.B.The$VARshouldhavebeensetasVAR.C.dogneedsdoublequotesarounditwhensetting$VAR.D.The{}shouldnotbearoundVARintheechocomm

题目
Giventhefollowingscript,whydoestheoutputcomeoutasanemptylineinsteadof"dog"()!/bin/ksh$VAR=dogecho"${VAR}"

A.The$VARvariablewasnotexported.

B.The$VARshouldhavebeensetasVAR.

C.dogneedsdoublequotesarounditwhensetting$VAR.

D.The{}shouldnotbearoundVARintheechocommand.


相似考题
参考答案和解析
参考答案:B
更多“Giventhefollowingscript,whydoestheoutputcomeoutasanemptylineinsteadof"dog"()!/bin/ksh$VAR=dogecho"${VAR}" ”相关问题
  • 第1题:

    ASystempcustomerhasinstalledcomponentsfromtheLinuxToolBox.Bydefault,whichofthefollowingdirectorieswillcontaintheopensourcecommandssuchasgzip,gunzipandzcat()

    A./opt/freeware/bin

    B./usr/bin/freeware

    C./var/freeware/bin

    D./usr/sbin/freeware


    参考答案:A

  • 第2题:

    Whatisthemostlikelyproblemwiththisscript()VAR=1((VAR=$VAR+1))while[$VAR-It10]doecho$VARdone

    A.#!/bin/kshlineismissing

    B.VariablenameVARisnotproperlyinitialized

    C.Loopvariableisnotincrementedinsidetheloop

    D.Replacebracketswithbraces


    参考答案:C

  • 第3题:

    An operator needs to change from the /usr/bin to the /var/spool directory. Which of the following commands will accomplish this?()

    A. cd /var/spool

    B. lcd /var/spool

    C. cd /usr/bin /var/spool

    D. lcd /usr/bin /var/spool


    参考答案:A

  • 第4题:

    ASystempadministratorsuspectstheyarereceivinganerrorfromoneoftheirnightlycronjobs.Thejobis:01***/usr/local/bin/nightlycheck.plWhereshouldtheadministratorfirstlookforerrorsreportedbythiscronjob()

    A./var/log/syslog.out

    B.var/log/cron.log

    C./var/spool/cron/logs

    D.mail


    参考答案:D

  • 第5题:

    Giventhefollowingscripts,whatoutputwouldbegenerated()usr/local/bin/scriptl!/usr/bin/kshVARl=redexportVARl=greenVARl=blue/usr/local/bin/script2ARl=yellow/usr/local/bin/script2!/bin/kshecho"Theskyis${VAR1}."

    A.Theskyisred.

    B.Theskyisblue.

    C.Theskyisgreen.

    D.Theskyisyellow.


    参考答案:C