#Bun shell: can't do echo with parameters

1 messages · Page 1 of 1 (latest)

swift ember
#

Hey there 👋,

I can't do an echo command with parameters using Bun shell.

For example, I got the output -ne \0\0\x26 with the code below:

const output = await $`echo ${{ raw: '-ne "\\0\\0\\x26"' }}`.text()
console.log("==>", output)

I also tried with

await $`echo -ne "\\0\\0\\x26"`.text()` 

but it's not better: -ne \\0\\0\\x26\n

The final goal is to do a full command like echo -ne "\0\0\x26" > /dev/hidg0 && echo -ne "\0\0" > /dev/hidg0 (works perfectly directly in the terminal)

Thank's in advance 🥰

fair thorn
#

-ne isn't supported on bun shell's implementation

#

if your system has echo as a binary (/bin/echo, /sbin/echo, or some other location) use that by passing the full path