From: Spencer Imbleau Date: Fri, 8 Jan 2021 00:15:02 +0000 (-0500) Subject: FEATURE: Changed awk config command to be more cross platform (#513) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=06aa4ddb769bf5164758190559378e36303a4a97;p=discourse_docker.git 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. --- 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") }