Autor Thema: $EVENT not working  (Gelesen 1420 mal)

Offline andyclimb

  • Full Member
  • ***
  • Beiträge: 141
$EVENT not working
« am: 07 Mai 2015, 13:58:44 »
Hi all,

I'm trying to pass an event that has spaces in it to the command line..

here is my notify
ws2812_mode { system "ssh rasplex '/usr/bin/hyperion-remote -e '$EVENT' ' &" } if i issue
set ws2812_mode Knight rider
then this is generated...

Start effect Knight
Connected to localhost:19444

so it is connecting but only sending what is equivalent to $EVTPART0, it is not sending the whole EVENT.  I get the same thing if i just echo it to the command line.  Is this a bug?
 
« Letzte Änderung: 07 Mai 2015, 14:01:28 von andyclimb »
AM

Offline rudolfkoenig

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 24704
Antw:$EVENT not working
« Antwort #1 am: 07 Mai 2015, 14:34:41 »
{ system "CMD &" } is in FHEM more or less equivalent with "CMD"
The argument seems strange to me, it contains way too many single quotes.
Have you tested the command without FHEM? Passing a space in an argument over SSH is sometimes a challenge.

Offline Markus Bloch

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 3683
Antw:$EVENT not working
« Antwort #2 am: 09 Mai 2015, 13:57:56 »
you need to escape:

ws2812_mode { system "ssh rasplex \"/usr/bin/hyperion-remote -e '$EVENT' \" &" }
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)