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

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

  • Gives error as Failed to parse arguments: Unknown option -c ! – Am_I_Helpful Jan 18 '15 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 '15 at 21:28
  • Yeah, that helped. Thanks a lot... An upvote for you too... – Am_I_Helpful Jan 18 '15 at 21:36
  • 1
    Thanks :D you are the first one, I could help in this forum :D – sedrubal Jan 18 '15 at 22:47
1

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

  • @shekharsuman yup yup. I had the same issue. – Thomas Streiff Feb 2 '15 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.