Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
script help
- X-seq: zsh-users 17463
- From: shawn wilson <ag4ve.us@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: script help
- Date: Sat, 8 Dec 2012 06:15:15 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=xDIlZXhHHH9RrrVw3VbfJ1tw2vQVbhVQCB0Vm11PNN4=; b=sPwpu7SojNguQNo+dMhAPcyKFLgfaIFrox3Lz5RT17nh2a1sF1vUirhsiMnOUEX90f opNL9AgXY87dvXTgnVj0RRgxYe22B8Os02TQ/ijf5Pxtr3HPCTTbZ1Hc41XLjjb8hK1p IRisGiKPhHNt2ri96wLm+4cb8dG/aFZS+vSIVcteyUT0Bso3NnitXQRdVsLJRzAwYnCr 7E30zXpvJGWrUyAenrqff+4Hw4o3Glufw+jUUUqITQGzHyQ1n0Rn4Z74BRcvbVU5OxU+ VF/8NkHz3IUNcULO6J99DtXHZW86fE69weVJS42amCLmzzlxtb7M03lEeEEkJBU/rxEp HojQ==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
this is in my .zshrc file and it fails to execute $cmd with:
vim:45: no such file or directory: /usr/local/bin/vim --servername SWILSON
######## zshrc part:
# make vim use or initialize a session with a new tab unless...
vim () {
local cmd
local servername
local remote
local username=$(echo $USER | tr "[:lower:]" "[:upper:]")
local opt_ex="^-"
while [ $# -gt 0 ] ; do
case "$1" in
--servername)
if [[ $1 =~ $opt_ex ]] ; then
echo "Servername option without a parameter. Doing nothing."
return
else
servername="$2"
return
fi
;;
--remote*)
if [ -z $remote ] ; then
remote=$1
else
# I'll deal with this properly if it is reasonable
to take multiple --remote* things
echo "Should not call two remote options at once.
Doing nothing."
return
fi
;;
*)
misc="$misc $1"
;;
esac
shift
done
cmd="/usr/local/bin/vim"
if [ ! -z $servername ] ; then
cmd="$cmd --servername $servername"
else
cmd="$cmd --servername $username"
fi
if [ -z $misc ] && [ -z $remote ] ; then
$cmd
return
fi
if [ ! -z $remote ] ; then
cmd="$cmd $remote $misc"
else
cmd="$cmd --remote-tab $misc"
fi
$cmd
return
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author