commit 1b59d9bed884e2711fc00968c32184a2a8152166 parent 6a99b1975776220c20848135b353e61a70aaf2e0 Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 11 May 2014 12:26:41 +0000 use cut for field separation Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org> Diffstat:
M | autojoin | | | 2 | +- |
M | connectserver | | | 4 | ++-- |
M | hysteria | | | 6 | +++--- |
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/autojoin b/autojoin @@ -14,7 +14,7 @@ if [ $? -eq 1 ]; then exit 1 fi -host=$(echo $1 | awk -F: '{print $1}') +host=$(printf '%s' "$1" | cut -d ':' -f 1) shift for c in $*; do echo "/join $c" > "$ircdir/$host/in" diff --git a/connectserver b/connectserver @@ -14,8 +14,8 @@ fi . ./config -host=$(echo $1 | awk -F: '{print $1}') -port=$(echo $1 | awk -F: '{print $2}') +host=$(printf '%s' "$1" | cut -d ':' -f 1) +port=$(printf '%s' "$1" | cut -s -d ':' -f 2) tmux new-window "ii -i $ircdir -s $host -p $port -n $nick -f $fullname" tmux rename-window "$host" ./waitfile "$ircdir/$host/out" diff --git a/hysteria b/hysteria @@ -11,7 +11,7 @@ for h in $hosts; do done for c in $channels; do - host=$(echo $c | awk -F: '{print $1}') - channel=$(echo $c | awk -F: '{print $2}') - ./autojoin $host $channel + host=$(printf '%s' "$c" | cut -d ':' -f 1) + channel=$(printf '%s' "$c" | cut -s -d ':' -f 2) + ./autojoin "$host" "$channel" done