QuestionQ228

Automation

Question Image

Refer to the exhibit. Which command is executed from the Guest Shell to set the description on the first five interfaces of the Cisco Nexus switch?

  • A [guestshell@guestshell ~]$ for x in {1..5}; dohost ג€conf t ; interface eth1/$x ; description Server$xג€;
  • B [guestshell@guestshell ~]$ for x in {1..5}; do dohost ג€conf t ; interface eth1/$x ; description Server$xג€; done
  • C [guestshell@guestshell ~]$ for x in (1..5); do dohost ג€conf tג€; ג€interface eth1/$xג€ ; ג€description Server$xג€; done
  • D [guestshell@guestshell ~]$ for x in (1..5); dohost ג€conf t ; interface eth1/$x ; description Server$xג€;
Explanation

Cisco NX-OS Guest Shell uses dohost to execute valid NX-OS configuration commands on the host switch. A Bash for loop over {1..5}, terminated by done, runs the command chain once per interface number and sets Server1 through Server5 on Ethernet1/1 through Ethernet1/5.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!