I need the serial number of main board in a shel script. I know I should run the following command:

```
sudo dmidecode -t 2 

```

But the problem is that this command returns a bunch of text information and I only need to retrieve the serial number. Here is the output:

```
# dmidecode 2.12
SMBIOS 2.5 present.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: LENOVO
Product Name: 2842A23
Version: Not Available
Serial Number: 1ZG6Y9CF5C5
Asset Tag: Not Specified
Features: None
Location In Chassis: Not Specified
Chassis Handle: 0xFFFF
Type: Unknown
Contained Object Handles: 0

```

From all that text I just need to save `1ZG6Y9CF5C5` in a variable. I tried `grep` as follows:

```
sudo dmidecode -t 2 | grep 'Serial Number'

```

But it returns the whole line I think I should use a regex that could find the second word in a line. How is that possible in shell script?