Brainstorming Brainstorming - 10 months ago 63
Bash Question

Nest execute commands in bash

I am trying to associate a hotkey with opening vim with recent history browsing, thus I have wrote the following line

gnome-terminal -x "vim -c ':browse old'"

However this gives

Error: Failed to execute child process "vim -c ':browse old'" (No such file or directory)

What am I doing wrong?

Answer Source

Good news! The -x option of gnome-terminal makes it very easy to start a new terminal and run a new program in it. Just do:

gnome-terminal -x vim -c ':browse old'

The meaning of -x is that all subsequent arguments are passed to the program that you run, so no quoting is needed.