dot

packages and services management
Log | Files | Refs | README

commit ead7c4205f543b5ddcdd80752938d770fb61f340
parent d09ac8774adab489e5c76b4e930a0d87e9d2c61d
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 16 Mar 2018 11:52:12 +0100

use quotes everywhere

Diffstat:
Mbin/twt | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/twt b/bin/twt @@ -126,13 +126,13 @@ touch "$TWT_CONF" case "$1" in (tweet) [ "$#" -ne 2 ] && exec "$0" - msg=$(printf %s "$2" | sed 's|[^ ]*://[^ ]*|@<&>|' | tr '\n' ' ') + msg="$(printf %s "$2" | sed 's|[^ ]*://[^ ]*|@<&>|' | tr '\n' ' ')" while read -r usr url do - url=$(printf %s "$url" | sed 's/[&/\]/\\&/g') - new=$(printf %s "$usr" | sed 's/[&/\]/\\&/g') - usr=$(printf %s "$usr" | sed 's/./[&]/g') - msg=$(printf %s "$msg" | sed "s/@$usr/@<$new $url>/") + url="$(printf %s "$url" | sed 's/[&/\]/\\&/g')" + new="$(printf %s "$usr" | sed 's/[&/\]/\\&/g')" + usr="$(printf %s "$usr" | sed 's/./[&]/g')" + msg="$(printf %s "$msg" | sed "s/@$usr/@<$new $url>/")" done < "$TWT_CONF" printf '%s\t%s\n' "$(date +'%Y-%m-%dT%T%z' | sed 's/..$/:&/')" "$msg" \ >> "$TWT_FEED"