I am on Linux Mint 19.03
First of all, I can assure you that I have read most of the possible questions you might think this question of mine is a duplicate of.
Now, I basically want to type something in my terminal window to open a new terminal window and execute the commands.
Something like this:
[the part I am asking of] "echo $PATH; read"
This code should do open a new terminal, the $PATH variable should be displayed and read is just for halting the terminal.
I tried x-terminal-emulator -e or x-terminal-emulator -c or -x but I could never achieve to do this correctly.
All answers on this SE on the similar questions are both old answers and were using -e or -x but it says that those options are deprecated.
So, what is the most proper way of achieving this?
Thanks.
-eor-x;-). The problem with-ein gnome-terminal and alike is that they don't pass the (single!) argument to a shell via-cbut are actually parsing it themselves, and doing it BADLY. That's why the accepted answer works, because it's using a real shell.x-terminal-emulator -- sh -c 'echo $PATH; read'would've worked, too, with less quote clutter.-eis still the only way you could pass a command to terminal emulators likextermormlterm(and even those have different, strange ideas of what the arguments after-emean), so there's no general solution.x-terminal-emulatorx-terminal-emulator(which is a perl wrapper), does not support thegnome-terminal -- cmd and argsform which is "recommended" new way. Your first attempt failed for the same reason as my first suggestion -- that wrapper tries to be smart and turns the-e cmdintosh -c cmd, but the defaultshon your system doesn't supportreadwithout an argument. If you usedread fin the 1st place, your attempt would've worked.x-terminal-emulator -e bash -c '...'orgnome-terminal -- bash -c '...'will work, butx-terminal-emulator -e '...'orgnome-terminal -e '...'will get you into trouble if the'...'is anything but a simpleprogram arguments...command.