Ask Your Question
0

gnome-terminal command: how to source file?

asked 2014-08-05 11:46:34 -0600

Diddy gravatar image

Hi,

I am trying to create a shell script which basically prepares my workplace for a certain project: So it will open several terminal tabs with a specific directory. I got this part working:

gnome-terminal --tab --title netbeans --working-directory /home/diddy/apps/netbeans-8.0/bin --execute ./netbeans

But there is one thing left: Before starting the program, it should source a project specific shell file which sets various variables. How do I do this?

Thanks, Diddy

edit retag flag offensive close merge delete

Comments

Perfect! Convert to answer?

abadrinath gravatar imageabadrinath ( 2014-08-08 03:06:21 -0600 )edit

@hello thank you! I didn't post it as answer since I was not sure if he has described the problem very well. It seems that he at least knows what "sourcing" is, so he should be already familiar with 'source' command. Maybe his problem was not exporting variables...?!

hedayat gravatar imagehedayat ( 2014-08-08 12:29:50 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-08-05 20:26:56 -0600

hedayat gravatar image

What is your problem exactly?! You can source the shell file using source or . command (e.g. source ~/my_env_setup. Either the file should export the desired variables, or you should export them after sourcing the file if you want the programs you run to see the variables:

source ~/setup_file
export VAR1 VAR2 VAR3
gnome-terminal --tab --title netbeans --working-directory /home/diddy/apps/netbeans-8.0/bin --execute ./netbeans
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-08-05 11:46:34 -0600

Seen: 818 times

Last updated: Aug 05 '14