Hello,
Is it possible to redirect output from a system command within the proc:execute function?
I would like to do something like:
proc:execute("echo", ("hello!", "> hello.txt"))
but the ">" does not seem to be recognized.
Thanks in advance, Tim
-- Tim A. Thompson Discovery Metadata Librarian Yale University Library
On Thu, 2020-04-09 at 16:00 -0400, Tim Thompson wrote:
proc:execute("echo", ("hello!", "> hello.txt"))
You could run, bash -c 'echo hello > hello.txt' instead, maybe?
This is assuming you are using Linux or the Linux subsystem on Windows, or cygwin, or OS X... so bash is available.
Ah, of course. Thank you, Liam! That's what I needed.
All best, Tim
-- Tim A. Thompson Discovery Metadata Librarian Yale University Library
On Thu, Apr 9, 2020 at 4:31 PM Liam R. E. Quin liam@fromoldbooks.org wrote:
On Thu, 2020-04-09 at 16:00 -0400, Tim Thompson wrote:
proc:execute("echo", ("hello!", "> hello.txt"))
You could run, bash -c 'echo hello > hello.txt' instead, maybe?
This is assuming you are using Linux or the Linux subsystem on Windows, or cygwin, or OS X... so bash is available.
-- Liam Quin, https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org
basex-talk@mailman.uni-konstanz.de