You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
302 B
14 lines
302 B
|
3 years ago
|
#!/usr/bin/env bash
|
||
|
|
|
||
|
|
IFS=$'\n' read -r -d '' -a array < <(dmidecode -t memory | grep "[Ss]ize")
|
||
|
|
if [[ ${#array[@]} -gt "0" ]]; then
|
||
|
|
for f in "${!array[@]}"; do
|
||
|
|
echo "'${array[f]}'"
|
||
|
|
ramsize=$(printf %s "${array[num]}" | awk '{print $2}')
|
||
|
|
echo "'$ramsize'"
|
||
|
|
done
|
||
|
|
fi
|
||
|
|
|
||
|
|
exit
|
||
|
|
|