ansiweather

Weather in terminal, with ANSI colors and Unicode symbols
Log | Files | Refs | README | LICENSE

commit 68fb624fa691d452e8610a7e51dfd2682ddc25be
parent 9f37223fc102269c9126687c66f1e9d64ed004a7
Author: Niklas Lindgren <niklas.lindgren@iki.fi>
Date:   Wed, 27 May 2020 16:19:28 +0100

Use cut instead of awk for reading the config file

The way the config file is currently read prevents using the colon (`:`) as part of the config value. Setting e.g. `timeformat:%H:%M` will result in only the hour being displayed.

Using `cut` instead of `awk` would allow reading the config file as currently, while ignoring any but the first occurrence of the key-value separator.
Diffstat:
Mansiweather | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ansiweather b/ansiweather @@ -34,7 +34,7 @@ get_config() { ret="" if [ -f "$config_file" ] then - ret=$(grep "^$1:" "$config_file" | awk -F: '{print $2}') + ret=$(grep "^$1:" "$config_file" | cut -d: -f2-) fi if [ "X$ret" = "X" ]