[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: os.execute(echo -n "text") error
- From: Douglas J Davenport <puzzlery@...>
- Date: Sun, 10 Dec 2017 04:39:10 -0500
> On 2017-Dec-10, at 3:46 AM, Mason Mackaman <email@example.com> wrote:
> When I run this command in my Bash shell, the output I get is "-n text". Is this a bug or am I messing up something simple? I've never encountered this problem with os.execute before .
Most likely the shell used to evaluate the parameters to the system() call does not support the -n option. Try:
/bin/sh -c ‘echo -n “text”'
/bin/bash -c ‘echo -n “text”’
I get “-n text” as output to the first command and “text” to the second.
On most systems Lua will had the os.execute() parameter to /bin/sh for processing as that is the behavior of the system() call.