I am looking for a way to launch a terminal session from the command line on Ubuntu, something like this:
#/usr/bin/env bash
terminal -c 'node server.js'
if there is some cross-platform tool that also works on MacOS that'd be nice.
So I tried this:
gnome-terminal -- 'echo "foo" | bash'
and I got this:
And when I try this:
gnome-terminal --tab -- echo 'ts-node /home/oleg/codes/typeaware/doc-gen/lang/typescript/api/src/.test/express.test.ts' | bash
nothing happens, the gnome-terminal never opens.
Your initial command,
gnome-terminal -- 'echo "foo" | bash'
, attempts to run a program named literallyecho␣"foo"␣|␣bash
, which you most likely don't have on your system.The correct syntax would be
gnome-terminal -- sh -c 'echo "foo" | bash'
, but it would not help, unless you actually have an executable namedfoo
. You can see that the syntax is correct by tryingBut this is just a very complicated way of saying
As for the intended command, it probably should be