Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnome-terminal new tab with alias as command to execute

I've created an alias in .bashrc file as follows

alias myproject = 'cd ~/Desktop/myproject'

After saving the file when I restart my terminal, typing in myproject takes me to the project directory but when I try to use the alias as a command argument to a new gnome-terminal tab it throws an error,

gnome-terminal --tab -e "myproject"

throws the error

There was an error creating the child process for this terminal
Failed to execute child process "myproject" (No such file or directory)

What is wrong with this ?

like image 451
Mudassir Ali Avatar asked Jul 01 '13 10:07

Mudassir Ali


1 Answers

When a bash shell is started, per default bash executes the commands specified in .bashrc. This is how your shell knows your aliases.

Now your idea does not work because gnome-terminal never sees your .bashrc file.

You could try

gnome-terminal --working-directory='<path-to-your-home-directory>/Desktop/myproject/

like image 168
Klaus Avatar answered Oct 13 '22 00:10

Klaus