From 0269bec6f466b9ff76a8b2e89e546640b0fced52 Mon Sep 17 00:00:00 2001 From: Leonid Lapshin Date: Thu, 5 Nov 2020 22:08:19 +0300 Subject: [PATCH] grep first entry of PATH --- images/linux/scripts/installers/post-deployment.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/post-deployment.sh b/images/linux/scripts/installers/post-deployment.sh index 4202469d2..c14c00d77 100644 --- a/images/linux/scripts/installers/post-deployment.sh +++ b/images/linux/scripts/installers/post-deployment.sh @@ -18,7 +18,7 @@ rm -rf $INSTALLER_SCRIPT_FOLDER chmod 755 $IMAGE_FOLDER # Remove quotes around PATH -ENVPATH=$(grep 'PATH=' /etc/environment | tail -1 | sed -z 's/^.*PATH=*//') +ENVPATH=$(grep 'PATH=' /etc/environment | head -n 1 | sed -z 's/^PATH=*//') ENVPATH=${ENVPATH#"\""} ENVPATH=${ENVPATH%"\""} echo "PATH=$ENVPATH" | sudo tee -a /etc/environment