Commit e7168245 authored by Dylan Araps's avatar Dylan Araps

gpu: Correctly filter out duplicates

parent eb62c843
......@@ -1113,7 +1113,9 @@ get_gpu() {
"Linux")
# Read GPUs into array.
IFS=$'\n'
gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' '/"Display|"3D|"VGA/ {print $3 " " $4}' | uniq))
gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' \
'/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END{for(i in a)
{if(!seen[a[i]]++) print a[i]}}'))
IFS="$old_ifs"
# Number the GPUs if more than one exists.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment