zsh-users
 help / color / mirror / code / Atom feed
* ssh zsh and one off commnad
@ 2013-08-13 12:00 Wawrzek Niewodniczanski
  2013-08-13 12:38 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Wawrzek Niewodniczanski @ 2013-08-13 12:00 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

Hi,

I hope you can help me in this situation. The default shell on remote
machine is bash, but I would like from time to time run  a zsh command or
rather set of command in a loop.  My test command for some reason doesn't
work:

ssh remote "zsh -c 'for i (/usr/*(/)) {ls $i }'"

Every time I got output from my home directory and $i seems to be empty, I
welcome any suggestion (other than changing default script on remote
machine).

Thanks,
Wawrzek


-- 
Dr  Wawrzyniec Niewodniczański    or Wawrzek for short
  PhD in Quantum Chemistry  & MSc in Molecular Engineering
   WWW: http://wawrzek.name E-MAIL: jobs@wawrzek.name
      Linux User #177124

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ssh zsh and one off commnad
  2013-08-13 12:00 ssh zsh and one off commnad Wawrzek Niewodniczanski
@ 2013-08-13 12:38 ` Peter Stephenson
  2013-08-13 13:30   ` Wawrzek Niewodniczanski
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2013-08-13 12:38 UTC (permalink / raw)
  To: Zsh Users

On Tue, 13 Aug 2013 13:00:39 +0100
Wawrzek Niewodniczanski <main@wawrzek.name> wrote:
> I hope you can help me in this situation. The default shell on remote
> machine is bash, but I would like from time to time run  a zsh command or
> rather set of command in a loop.  My test command for some reason doesn't
> work:
> 
> ssh remote "zsh -c 'for i (/usr/*(/)) {ls $i }'"
                                            ^^
The problem is that the $i is being substituted by the local shell,
because it's in a double-quoted expression (the single quotes inside
that are not special to the local shell).  Probably putting a backslash
in front of the $ should do the trick.

pws


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ssh zsh and one off commnad
  2013-08-13 12:38 ` Peter Stephenson
@ 2013-08-13 13:30   ` Wawrzek Niewodniczanski
  0 siblings, 0 replies; 3+ messages in thread
From: Wawrzek Niewodniczanski @ 2013-08-13 13:30 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

On 13 August 2013 13:38, Peter Stephenson <p.stephenson@samsung.com> wrote:

> On Tue, 13 Aug 2013 13:00:39 +0100
> Wawrzek Niewodniczanski <main@wawrzek.name> wrote:
>
> [...]


> > ssh remote "zsh -c 'for i (/usr/*(/)) {ls $i }'"
>                                             ^^
> The problem is that the $i is being substituted by the local shell,
> because it's in a double-quoted expression (the single quotes inside
> that are not special to the local shell).  Probably putting a backslash
> in front of the $ should do the trick.
>
>
That the hit!

Thanks for help,

Wawrzek



-- 
Dr  Wawrzyniec Niewodniczański    or Wawrzek for short
  PhD in Quantum Chemistry  & MSc in Molecular Engineering
   WWW: http://wawrzek.name E-MAIL: jobs@wawrzek.name
      Linux User #177124

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-13 13:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13 12:00 ssh zsh and one off commnad Wawrzek Niewodniczanski
2013-08-13 12:38 ` Peter Stephenson
2013-08-13 13:30   ` Wawrzek Niewodniczanski

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).