# memory stick slot
Slot_position=$(dmidecode | grep "Memory Device" - A21 | grep Locator | grep -v "Bank Locator" | awk -f ":" '{print $2}')
Memory # serial number
Memory_Serial=$(dmidecode | grep "Memory Device" - A21 | grep "Serial" | awk -f ":" '{print $2}')
# memory frequency
Memory_Rate=$(dmidecode | grep "Memory Device" - A21 | grep Speed | grep -v "Clock" | awk -f ":" '{print $2}')
Memory # size
Memory_Size=$(dmidecode | grep "Memory Device" - A8 | grep Size | awk -f ":" '{print $2}')
# how many slots
Memory_Slot=$(dmidecode | grep "Memory Device" - A21 | grep Speed | grep -v "Clock" | wc -l)
Printf "% s % s % s % s \ n" memory slot digit memory frequency memory chips memory size serial number
Printf "$Slot_position \ n", "
Printf "$Memory_Rate \ n", "
Printf "$Memory_Size \ n", "
Printf "$Memory_Serial \ n", "
Print out is:
P1 - DIMMA1
P1 - DIMMB1
P1 - DIMMC1
P1 - DIMMD1
P1 - DIMME1
P1 - DIMMF1
The P2 - DIMMA1
The P2 - DIMMB1
The P2 - DIMMC1
The P2 - DIMMD1
The P2 - DIMME1
The P2 - DIMMF1
2666 MHz
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
32 GB
No Module Installed
No Module Installed
No Module Installed
No Module Installed
No Module Installed
No Module Installed
No Module Installed
No Module Installed
No Module Installed
No Module Installed
No Module Installed
1 f602710
NO DIMM
NO DIMM
NO DIMM
NO DIMM
NO DIMM
NO DIMM
NO DIMM
NO DIMM
NO DIMM
NO DIMM
NO DIMM
But I want to list format:
P1-2666 MHz DIMMA1 f602710 32 GB 1
P1 - DIMMB1 Unknown No Module Installed No DIMM
P1 - DIMMC1 Unknown No Module Installed No DIMM
P1 - DIMMD1 Unknown No Module Installed No DIMM
P1 - DIMME1 Unknown No Module Installed No DIMM
P1 - DIMMF1 Unknown No Module Installed No DIMM
The P2 - DIMMA1 Unknown No Module Installed No DIMM
The P2 - DIMMB1 Unknown No Module Installed No DIMM
The P2 - DIMMC1 Unknown No Module Installed No DIMM
The P2 - DIMMD1 Unknown No Module Installed No DIMM
The P2 - DIMME1 Unknown No Module Installed No DIMM
How to change?
CodePudding user response:
Cycle print, insert between each column form codeP1 - DIMMB1 & lt;/td> | Unknown | No Module Installed | NO DIMM |