zsh-users
 help / color / mirror / code / Atom feed
From: Aaron Schrab <aaron@schrab.com>
To: shawn wilson <ag4ve.us@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: script help
Date: Sat, 8 Dec 2012 10:09:11 -0500	[thread overview]
Message-ID: <20121208150911.GA15808@pug.qqx.org> (raw)
In-Reply-To: <CAH_OBidxmYPtmxrmwMYyE2U9tytbiwC7AtKpNJ7va3oDG8p66Q@mail.gmail.com>

At 06:15 -0500 08 Dec 2012, shawn wilson <ag4ve.us@gmail.com> wrote:
>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

Normally zsh doesn't split the result of variable expansion into 
separate words.  You can enable that for your function by adding the 
following line to it:

setopt local_options sh_word_split

Enabling the local_options option will cause other options set within 
the function to be returned to their original state when the function 
returns.  The sh_word_split option will cause the results of expanding 
your $cmd variable to be split into words before evaluating that line, 
allowing it to be used as you intended.

Another option would be to use ${=cmd} in place of just $cmd when you 
attempt to run that command.  That will cause word splitting to be done 
in that case only.


  reply	other threads:[~2012-12-08 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-08 11:15 shawn wilson
2012-12-08 15:09 ` Aaron Schrab [this message]
2012-12-08 15:43   ` shawn wilson
2012-12-08 17:07     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121208150911.GA15808@pug.qqx.org \
    --to=aaron@schrab.com \
    --cc=ag4ve.us@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).