From 979270dcc267fb106e74a8f899a4ca6e7bb11dd1 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Thu, 2 Sep 2021 21:14:17 +0100 Subject: [PATCH] escaping sed quotes correctly --- roles/jupyterhub/templates/patch_await.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/jupyterhub/templates/patch_await.sh b/roles/jupyterhub/templates/patch_await.sh index bf4346413..50b292535 100755 --- a/roles/jupyterhub/templates/patch_await.sh +++ b/roles/jupyterhub/templates/patch_await.sh @@ -9,11 +9,11 @@ if [ $? -ne 0 ];then else echo Await patch already applied. Skipping. . . fi -cat $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py |grep data['data'].lower()' +cat $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py |grep "data\['username'\].lower\(\)" if [ $? -ne 0 ];then - echo Updating to data['username'].lower() - sed -i -e's/data['username']/data['username'].lower()/' $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py + echo Updating to data['username'].lower\(\) + sed -i -e"s/data\['username'\]/data\['username'\].lower\(\)/" $SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py else - echo username.lower() patch already applied. Skipping. . . + echo username.lower\(\) patch already applied. Skipping. . . fi