From 52d319d23ea2274198532f79af1727cc217dff4b Mon Sep 17 00:00:00 2001 From: Adil Date: Thu, 28 Oct 2021 22:42:48 -0400 Subject: [PATCH] Fix: variable $nc not substituted $nc in sed should be used between " insted of ' No need for sudo --- 1-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-setup.sh b/1-setup.sh index 9787056..1d68750 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -25,9 +25,9 @@ echo "-------------------------------------------------" echo "Changing the makeflags for "$nc" cores." TOTALMEM=$(cat /proc/meminfo | grep -i 'memtotal' | grep -o '[[:digit:]]*') if [[ $TOTALMEM -gt 8000000 ]]; then -sudo sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$nc"/g' /etc/makepkg.conf +sed -i "s/#MAKEFLAGS=\"-j2\"/MAKEFLAGS=\"-j$nc\"/g" /etc/makepkg.conf echo "Changing the compression settings for "$nc" cores." -sudo sed -i 's/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g' /etc/makepkg.conf +sed -i "s/COMPRESSXZ=(xz -c -z -)/COMPRESSXZ=(xz -c -T $nc -z -)/g" /etc/makepkg.conf fi echo "-------------------------------------------------" echo " Setup Language to US and set locale "