0

NOTE :- This is not a duplicate question. I have searched about 100 times on this site and several others including Ubuntuforums,askubuntu and stackoverflow. I couldn't get my work done.

OBJECTIVE :- I want to have a command running on three different terminals which will all start with the login of the user. The 3 terminals will be opened simultaneously without any inter-relationship.

Sensors-Command

Sensors-Monitoring

Open Processing

How can I achieve this? I tried doing things which I have listed below :-

  1. Added script for doing this at system startup(using /etc/init.d and making symbolic links in rc2.d) which started the services but didn't show the processes running in the terminals.

  2. Took direct help of rc.local(inside rc.d) and appended the commands in that file as suggested somewhere. That also did the same as first.

  3. Directly used the autostart-program options to start programs manually after login of the user. This too failed to open the terminal.

My Script content :-

#! /bin/bash
gnome-terminal -e "watch sensors";   ### this is working, others aren't.
gnome-terminal -e gedit /etc/hostname  ### not working
gnome-terminal -e processing /home/Desktop/samudra_gui/samudra_gui.pde

QUESTION :- HOW SHOULD I ACHIEVE THIS ??? WHAT SHOULD I DO SO THAT THE 3 TERMINALS DON't AUTOCLOSE AFTER EXECUTING 3 COMMANDS AFTER LOGIN ? PLEASE HELP!

2 Answers 2

2

may try:

gnome-terminal -e "bash -c 'watch sensors'"
gnome-terminal -e "bash -c 'gedit /etc/hostname'"
gnome-terminal -e "bash -c 'processing /home/Desktop/samudra_gui/samudra_gui.pde'"

and start this script from .bashrc or write this in .bashrc

4
  • Gives error as Failed to parse arguments: Unknown option -c ! Jan 18, 2015 at 17:07
  • 1
    ah ok try this: gnome-terminal -e "bash -c 'watch sensors'" gnome-terminal -e "bash -c 'gedit /etc/hostname'" gnome-terminal -e "bash -c 'processing /home/Desktop/samudra_gui/samudra_gui.pde'"
    – sedrubal
    Jan 18, 2015 at 21:28
  • Yeah, that helped. Thanks a lot... An upvote for you too... Jan 18, 2015 at 21:36
  • 1
    Thanks :D you are the first one, I could help in this forum :D
    – sedrubal
    Jan 18, 2015 at 22:47
1

Edit .bashrc Or .bash_profile. http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_01.html

1
  • @shekharsuman yup yup. I had the same issue. Feb 2, 2015 at 0:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .