aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepoch <epoch@hack.thebackupbox.net>2020-12-22 07:05:47 +0000
committerepoch <epoch@hack.thebackupbox.net>2020-12-22 07:05:47 +0000
commit6dc4ece3b894b24dee0e1062c22f6c1bf205604a (patch)
tree7354e078b27503fd9b4c4bec54e91b8be31be949
parent1a9d4eef06abda47620bbb7f2dda2c981d5a2ce4 (diff)
downloaduritools-6dc4ece3b894b24dee0e1062c22f6c1bf205604a.tar.gz
uritools-6dc4ece3b894b24dee0e1062c22f6c1bf205604a.zip
urigetline now uses $uristart_config, if set, to find the config file
-rwxr-xr-xurigetline6
1 files changed, 5 insertions, 1 deletions
diff --git a/urigetline b/urigetline
index 6d20320..3f6bb51 100755
--- a/urigetline
+++ b/urigetline
@@ -3,8 +3,12 @@ uri="$1"
### old way.
# line="$(grep "^${scheme}:" ~/.config/uristart.conf | cut -d: -f2- | sed 's/^[ \t]*//g' | sed 's/\\/\\\\/g')"
+if [ ! "$uristart_config" ];then
+ uristart_config=~/.config/uristart.conf
+fi
+
### fancy way.
-grep '^[^#]' ~/.config/uristart.conf \
+grep '^[^#]' "$uristart_config" \
| while read -r l;do
uritmp="$uri"
uritmp="$(printf "%s\n" "$l" \