You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env node
let spawn = require("child_process").spawn;
function showContent(content) {
spawn(`cat <<< "${content}" | less -r`, {
stdio: "inherit", // use the current shell for stdio
shell: true,
});
}
showContent("hello");
-rwxr-xr-x test.js
the function is executable. so ./test.js is ok. while error is produce. error is the following
/bin/sh: 1: Syntax error: redirection unexpected
How often does it reproduce? Is there a required condition?
on my mac OS, it is ok, while in the linux, the error will trigger.
What is the expected behavior?
perform normal
What do you see instead?
Additional information
I dig into the <<< redirection,The default system shell in Ubuntu is dash, not bash. Dash does not have the <<< redirection operator. that could be the problem. while I don't know how to solve it. stackoverflow
The text was updated successfully, but these errors were encountered:
What steps will reproduce the bug?
test.js
the function is executable. so
./test.js
is ok. while error is produce. error is the followingHow often does it reproduce? Is there a required condition?
on my mac OS, it is ok, while in the linux, the error will trigger.
What is the expected behavior?
perform normal
What do you see instead?
Additional information
I dig into the
<<<
redirection,The default system shell in Ubuntu is dash, not bash. Dash does not have the <<< redirection operator. that could be the problem. while I don't know how to solve it.stackoverflow
The text was updated successfully, but these errors were encountered: