From 1241f839f7719cb62669a1658a90ab910eff5ad8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 8 Jan 2017 12:26:59 +1100 Subject: [PATCH] General: Remove readarray usage --- neofetch | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 9de18241..72d57bd2 100755 --- a/neofetch +++ b/neofetch @@ -11,6 +11,7 @@ bash_version="${BASH_VERSION/.*}" sys_locale="${LANG:-C}" XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}" +old_ifs="$IFS" # Speed up script by not using unicode. export LC_ALL=C @@ -993,7 +994,9 @@ get_gpu() { case "$os" in "Linux") # Read GPUs into array. - readarray gpus < <(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}') + IFS=$'\n' + gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}')) + IFS="$old_ifs" # Number the GPUs if more than one exists. ((${#gpus[@]} > 1)) && gpu_num=1 @@ -1624,7 +1627,9 @@ get_disk() { # Create an array called 'disks' where each element is a separate line from # df's output. We then unset the first element which removes the column titles. - readarray disks < <(df "${df_flags[@]}" "${disk_show[@]:-/}") && unset 'disks[0]' + IFS=$'\n' + disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}")) && unset 'disks[0]' + IFS="$old_ifs" # Stop here if 'df' fails to print disk info. [[ -z "${disks[@]}" ]] && \