Re: Escaping BASH quotes
| From: | Danny | Date: | Tue, 02 Feb 2016 15:57:15 +0000 |
| Subject: | Re: Escaping BASH quotes | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-325373@lists.php.net to get a copy of this message | ||
Yes I have ... ;) ... The problem I am experiencing is that the "-e" following
the echo command is also sent to /dev/ttyS1 ...
On Feb 02 16, shiplu :
> To: Danny <mynixmail@gmail.com>, php-general General List
> <php-general@lists.php.net>
> Date: Tue, 02 Feb 2016 15:57:35 +0000
> From: shiplu <shiplu.net@gmail.com>
> Subject: Re: [PHP] Escaping BASH quotes
>
> Did you try opening that device file directly with php's built-in fopen and
> write those strings with fwrite?
>
> On Tue, 2 Feb 2016 9:09 pm Danny <mynixmail@gmail.com> wrote:
>
> Hi guys,
>
> I need to send a command to BASH with quotes ... I have tried escapeshelarg
> ()
> and escapeshellcmd ... but somewhere I still have a bug:
>
here are the BASH commands I need to escape:
echo -e "\rMYCOMMAND\r" > /dev/ttyS1
echo -e ":AB7ASD-02:Command Msg:VF3LPO" > /dev/ttyS1
echo -e "\r\03\r" > /dev/ttyS1
>
> At the moment I am using exec() to send these lines ...
>
> Any pointers?
>
> Thank you
>
> Danny
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>