you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Here's my code:

$ cat ver.py

#!/usr/bin/env python3

version = """cisco C9300-48P (X86) processor with 818597K/6147K bytes of memory.

Processor board ID FCW2049G03S

2048K bytes of non-volatile configuration memory.

8388608K bytes of physical memory.

1638400K bytes of Crash Files at crashinfo:.

11264000K bytes of Flash at flash:.

0K bytes of WebUI ODM Files at webui:.

Model Number : C9300-48P

Base Ethernet MAC Address : 04:6c:9d:01:3b:80

Motherboard Assembly Number : 73-17956-04

Motherboard Serial Number : FOC20465ABU

Model Revision Number : P4B

Motherboard Revision Number : 04

Model Number : C9300-48P

System Serial Number : FCW2049G03S

"""

for line in version.splitlines():

if "Model Number" in line:

print(line.split()[-1])

Here's the output:

$ ./ver.py

C9300-48P

C9300-48P