From ee6dbaf1f21e875afbd7540ca3a95602107f58c8 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 17 Mar 2015 22:06:43 +0000 Subject: [PATCH] alerts --- etc/bashrc.function | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/bashrc.function b/etc/bashrc.function index 682490d8..b83bcf7c 100644 --- a/etc/bashrc.function +++ b/etc/bashrc.function @@ -10,7 +10,7 @@ case "$OSTYPE" in darwin*) } mac-xmessage() { - osascript -e 'tell app "System Events" to display dialog "'$@'"' + osascript -e "tell app \"System Events\" to display dialog \"$@\"" } mac-config() { @@ -256,7 +256,7 @@ nb-alert() { ;; *) host=macbook.brighton.loc - cmd="mac-xmessage $FUNCNAME:$1" + cmd="mac-xmessage \"$FUNCNAME: $1\" 1>/dev/null" ;; esac cmd=". $NB_ROOT/etc/profile.sh && $cmd" @@ -264,9 +264,9 @@ nb-alert() { local ip=`dig +short $host` [ -z "$ip" ] && echo "Can't resolve macbook.brighton.loc" && return 1 - nb-ips | grep -qFm1 "$ip" || cmd="ssh -o BatchMode=yes $host '$cmd'" + nb-ips | grep -qFm1 "$ip" || cmd="ssh -o BatchMode=yes $host -- $cmd" - [ "$USER" != "nico" ] && cmd="su - nico -c \"$cmd\"" + [ "$USER" != "nico" ] && cmd="su - nico -c '$cmd'" eval "$cmd" } -- 2.47.3