From dd100336ba43ae83707e6108ab0054ae5345443a Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Sun, 18 Aug 2024 10:07:58 -0400 Subject: [PATCH 1/2] Update DEMO.md with awk expression Use awk for the entire expression when setting the LABPASSPHRASE. It is a useless use of cat and awk can perform the filtering grep was used for. It makes the expression shorter and concise. --- DEMO.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DEMO.md b/DEMO.md index 1d1c8f5..e2e79a1 100644 --- a/DEMO.md +++ b/DEMO.md @@ -17,7 +17,7 @@ Because the password is auto-generated, you must update the `ansible_password` v Run the following commands from the Programmability IDE terminal: ```shell -export LABPASSPHRASE=`cat /home/coder/.config/code-server/config.yaml| grep "password:" | awk '{print $2}'` +export LABPASSPHRASE=`awk '/password:/{print $2}' /home/coder/.config/code-server/config.yaml` ``` ## 3. Install all the requirements @@ -34,7 +34,7 @@ The code block below performs the following actions: ```shell cd /home/coder/project/labfiles - export LABPASSPHRASE=`cat /home/coder/.config/code-server/config.yaml| grep "password:" | awk '{print $2}'` + export LABPASSPHRASE=`awk '/password:/{print $2}' /home/coder/.config/code-server/config.yaml` ansible-galaxy collection install arista.avd:==4.10.0 pip3 config set global.break-system-packages true pip3 config set global.disable-pip-version-check true From 0c70328d1e2d450160a2e9518f140c1877065704 Mon Sep 17 00:00:00 2001 From: Michael Bear <38406045+mjbear@users.noreply.github.com> Date: Sun, 18 Aug 2024 10:10:15 -0400 Subject: [PATCH 2/2] Update README.md with awk expression Similar to the DEMO.md file... Use awk for the entire expression when setting the LABPASSPHRASE. It is a useless use of cat and awk can perform the filtering grep was used for. It makes the expression shorter and concise. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a9cc3a..6a3fc9d 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The diagram below shows that the ATD lab topology has two data centers. We will ```shell cd /home/coder/project/labfiles - export LABPASSPHRASE=`cat /home/coder/.config/code-server/config.yaml| grep "password:" | awk '{print $2}'` + export LABPASSPHRASE=`awk '/password:/{print $2}' /home/coder/.config/code-server/config.yaml` ansible-galaxy collection install arista.avd:==4.10.0 pip3 config set global.break-system-packages true pip3 config set global.disable-pip-version-check true