From 06aa4ddb769bf5164758190559378e36303a4a97 Mon Sep 17 00:00:00 2001 From: Spencer Imbleau Date: Thu, 7 Jan 2021 19:15:02 -0500 Subject: [PATCH] FEATURE: Changed awk config command to be more cross platform (#513) in Ubuntu 20.04 LTS, pre installed is mawk 1.3.4, which is called when you use awk. In this version, "--field-seperator" is not a valid option, leaving discourse-doctor with many errors. Described in https://meta.discourse.org/t/discourse-doctor-parsing-smtp-credentials-not-working-admin-registration-email-not-working/174461, this commit aims to use -F as the accepted flag for field separation which is unambiguous across GNU AWK and Ubuntu MAWK. --- discourse-doctor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discourse-doctor b/discourse-doctor index 4d66900..bf8119b 100755 --- a/discourse-doctor +++ b/discourse-doctor @@ -210,7 +210,7 @@ dump_yaml() { ## read_config() { config_line=$(egrep "^ #?$1:" $web_file) - read_config_result=$(echo $config_line | awk --field-separator=":" '{print $2}') + read_config_result=$(echo $config_line | awk -F ":" '{print $2}') read_config_result=$(echo $read_config_result | sed "s/^\([\"']\)\(.*\)\1\$/\2/g") } -- 2.25.1