os:command queston

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

os:command queston

Lloyd R. Prentice-2
Hello,

This error just bit me:

Eshell V10.4  (abort with ^G)
1> os:command(pdflatex --shell-escape tex/oblivious.tex).
* 1: syntax error before: tex

I did a Google search, but couldn't find out how to escape the period before tex.

So how might I do that?

Thanks,

LRP



Reply | Threaded
Open this post in threaded view
|

Re: os:command queston

Kenneth Lundin-5
the problem is not about escaping, it is tat the argument to os:cmd should be a string.

in you case 
os:cmd("pdflatex --shell-escape tex/oblivious.tex").

/Regards Kenneth 

On Fri, Apr 2, 2021, 19:06 Lloyd R. prentice <[hidden email]> wrote:
Hello,

This error just bit me:

Eshell V10.4  (abort with ^G)
1> os:command(pdflatex --shell-escape tex/oblivious.tex).
* 1: syntax error before: tex

I did a Google search, but couldn't find out how to escape the period before tex.

So how might I do that?

Thanks,

LRP



Reply | Threaded
Open this post in threaded view
|

Re: os:command queston

kuna.prime
In reply to this post by Lloyd R. Prentice-2
Hi,
I would assume you want to use os:cmd/1 function as os:command does not exist, and also shell command needs to be in quotes/string: os:cmd("pdflatex --shell-escape tex/oblivious.tex").

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, April 2, 2021 7:05 PM, Lloyd R. prentice <[hidden email]> wrote:

Hello,

This error just bit me:

Eshell V10.4  (abort with ^G)
1> os:command(pdflatex --shell-escape tex/oblivious.tex).
* 1: syntax error before: tex

I did a Google search, but couldn't find out how to escape the period before tex.

So how might I do that?

Thanks,

LRP




Reply | Threaded
Open this post in threaded view
|

Re: os:command queston

Bob Ippolito
In reply to this post by Lloyd R. Prentice-2
The argument to os:cmd/1 should be a string. 

os:cmd(“pdflatex --shell-escape tex/oblivious.tex”).

On Fri, Apr 2, 2021 at 10:06 Lloyd R. prentice <[hidden email]> wrote:
Hello,

This error just bit me:

Eshell V10.4  (abort with ^G)
1> os:command(pdflatex --shell-escape tex/oblivious.tex).
* 1: syntax error before: tex

I did a Google search, but couldn't find out how to escape the period before tex.

So how might I do that?

Thanks,

LRP



Reply | Threaded
Open this post in threaded view
|

Re: os:command queston

Dieter Schön
In reply to this post by Lloyd R. Prentice-2
Hi Lloyd,


I think os:command doesn't exist. If I try this, I get the same error:

7> os:gargantua(pdflatex --shell-escape tex/oblivious.tex).

* 1:38: syntax error before: tex


Have you tried

 > os:cmd("pdflatex --shell-escape tex/oblivious.tex").

regards,

Dieter


On 02.04.21 19:05, Lloyd R. prentice wrote:
> os:command(pdflatex --shell-escape tex/oblivious.tex).
Reply | Threaded
Open this post in threaded view
|

Re: os:command queston

Dieter Schön
addendum:

The error has nothing to do with the dot in oblivious.tex, it comes from
"before" the first tex:

If I change the first tex to hex:

1> os:command(pdflatex --shell-escape hex/oblivious.tex).
* 3: syntax error before: hex

If I try a valid parameter, erlang complains that os:command doesn't exist:

5> os:command("ls").
** exception error: undefined function os:command/1

But in the case of the unquoted string pdflatex --shell-escape tex....

the erlang parser first tries to evaluate the function arguments

pdflatex is an atom,

--shell-escape probably parses to lists:subtract, atom, minus, atom

and the parser gives up.

Shouldn't it already complain when it cannot find command in module os?


regards,

dieter



On 02.04.21 19:20, Dieter Schön wrote:

> Hi Lloyd,
>
>
> I think os:command doesn't exist. If I try this, I get the same error:
>
> 7> os:gargantua(pdflatex --shell-escape tex/oblivious.tex).
>
> * 1:38: syntax error before: tex
>
>
> Have you tried
>
> > os:cmd("pdflatex --shell-escape tex/oblivious.tex").
>
> regards,
>
> Dieter
>
>
> On 02.04.21 19:05, Lloyd R. prentice wrote:
>> os:command(pdflatex --shell-escape tex/oblivious.tex).
Reply | Threaded
Open this post in threaded view
|

Re: os:command queston

Raimo Niskanen-11
On Fri, Apr 02, 2021 at 07:35:50PM +0200, Dieter Schön wrote:

> addendum:
>
> The error has nothing to do with the dot in oblivious.tex, it comes from
> "before" the first tex:
>
> If I change the first tex to hex:
>
> 1> os:command(pdflatex --shell-escape hex/oblivious.tex).
> * 3: syntax error before: hex
>
> If I try a valid parameter, erlang complains that os:command doesn't exist:
>
> 5> os:command("ls").
> ** exception error: undefined function os:command/1
>
> But in the case of the unquoted string pdflatex --shell-escape tex....
>
> the erlang parser first tries to evaluate the function arguments
>
> pdflatex is an atom,
>
> --shell-escape probably parses to lists:subtract, atom, minus, atom
>
> and the parser gives up.
>
> Shouldn't it already complain when it cannot find command in module os?

The parser can not know that this is a function call until it has parsed up
to the terminating ')'.  It has parsed all tokens, and then tries to fit
them into the syntax.  It is probably looking for the terminating ')' but
runs into problems at the '.' after 'oblivious'.  A '.' is only allowed in
a floating point number or in a record reference.  'oblivious' is not the
start of a floating point number and is missing the '#' so it cannot be a
record reference.

So it has a '.' that can not be a terminating dot because there a ')' is
missing, and it can not be a floating point number nor a record reference.
In short, this is not according to syntax.

That the intention was to create an argument list for a function call is
not on the table yet.

/ Raimo Niskanen



>
>
> regards,
>
> dieter
>
>
>
> On 02.04.21 19:20, Dieter Schön wrote:
> > Hi Lloyd,
> >
> >
> > I think os:command doesn't exist. If I try this, I get the same error:
> >
> > 7> os:gargantua(pdflatex --shell-escape tex/oblivious.tex).
> >
> > * 1:38: syntax error before: tex
> >
> >
> > Have you tried
> >
> > > os:cmd("pdflatex --shell-escape tex/oblivious.tex").
> >
> > regards,
> >
> > Dieter
> >
> >
> > On 02.04.21 19:05, Lloyd R. prentice wrote:
> >> os:command(pdflatex --shell-escape tex/oblivious.tex).

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB