Correct B
NXs1# guestshell
[admin@guestshell ~]$ for x in {1..5}; do dohost "conf t ; interface eth1/$x ; description Server$x" ; done
Enter configuration commands, one per line. End with CNTL/Z.
Enter configuration commands, one per line. End with CNTL/Z.
Enter configuration commands, one per line. End with CNTL/Z.
Enter configuration commands, one per line. End with CNTL/Z.
Enter configuration commands, one per line. End with CNTL/Z.
[admin@guestshell ~]$
Answer is B:
[admin@guestshell ~]$ for i in {1..5}; do dohost "conf t ; int eth1/${i} ; desc Server_${i}"; done
Enter configuration commands, one per line. End with CNTL/Z.
Enter configuration commands, one per line. End with CNTL/Z.
Enter configuration commands, one per line. End with CNTL/Z.
Enter configuration commands, one per line. End with CNTL/Z.
Enter configuration commands, one per line. End with CNTL/Z.
https://learnduty.com/tutorials/cisco-guest-shell-explained/
[guestshell@guestshell ~]$ for x in {1..5}; do dohost "conf t ; interface l$x ; ip address 10.0.0.$x 255.255.255.255" ; done
https://www.cyberciti.biz/faq/bash-for-loop/
as mentioned, bash for loop needs the do and done, and the "dohost" is the command that executes something onto the NX-OS
I don't know anything about BASH but none of the Cisco Documentation I have found online makes reference to the "do" or "done" commands, its simply executes from the "dohost" keyword, so Answer A or possibly D, as they look identical to me, would be correct.
Are you saying 'do/done' are required for the repition of the command acroos the 5 interfaces?
So use just "dohost" to execute on a single interface but use do dohost..... done to execute across 5 interfaces?
For anyone reading since my last comment a quick google search will show that dohost is required to run a Cisco command but do dohost is required to create a loop for when you need to for example add a description to 5 interfaces.
As advised by all these good people the answer is B
But everything in this guide shows only dohost without the do in front of it? https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/7-x/programmability/guide/b_Cisco_Nexus_9000_Series_NX-OS_Programmability_Guide_7x/Guest_Shell.html
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.350-601 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
freddycisco
Highly Voted 3 years, 5 months agoValkyrie17
Highly Voted 3 years, 5 months agonaleenh
Most Recent 9 months, 2 weeks agogroblok
1 year, 2 months agovladdar
1 year, 9 months agoC4rlos
1 year, 11 months agoHubchub67
2 years, 1 month agoGuyThatTakesDumps
2 years, 2 months agomahmoudlol
2 years, 4 months agomauchi
2 years, 7 months agoSmoothey
2 years, 8 months agomojzucha
3 years agoSwitchKiller
2 years, 8 months agoSwitchKiller
2 years, 7 months agojdub95
3 years, 3 months ago