zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Grant Taylor <gtaylor@tnetconsulting.net>, zsh-users@zsh.org
Subject: Re: How do you decide whether to make something a function or a script?
Date: Sun, 09 Sep 2018 02:21:14 +0000	[thread overview]
Message-ID: <1536459674.3644536.1501585440.2BF2B86D@webmail.messagingengine.com> (raw)
In-Reply-To: <c326defd-125c-823b-b281-a26b431e0727@spamtrap.tnetconsulting.net>

Grant Taylor wrote on Sat, 08 Sep 2018 19:55 -0600:
> I upgrade from functions to scripts when I want to be able to run the 
> command from outside of the shell, like an ssh remote command:  ssh 
> myserver openDB.  The remote command doesn't launch the shell, thus 
> doesn't have access to functions, much less aliases. But it does have
> access to scripts if I have my PATH configured properly.

The remote command in 'ssh myserver foo bar' indeed doesn't have
access to functions or aliases, but it does go through a shell on the remote
end.  It simply uses a non-interactive shell.  That's why changes to PATH in
zshenv are honoured by ssh commands, and why functions aren't available
(zshrc isn't read).

Cheers,

Daniel
(I don't mean to nitpick; sometimes this distinction matters.)


  reply	other threads:[~2018-09-09  2:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-09  1:22 TJ Luoma
2018-09-09  1:55 ` Grant Taylor
2018-09-09  2:21   ` Daniel Shahaf [this message]
2018-09-09  2:51     ` Grant Taylor
2018-09-09 19:34     ` TJ Luoma
2018-09-09 22:54       ` Bart Schaefer
2018-09-09  3:24 ` 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=1536459674.3644536.1501585440.2BF2B86D@webmail.messagingengine.com \
    --to=d.s@daniel.shahaf.name \
    --cc=gtaylor@tnetconsulting.net \
    --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).