How to export a var from one terminal tab to a other terminal tab ?
by Lennard37 from LinuxQuestions.org on (#5SP3Y)
The follow sample code are doing the follow:
* echo the pid of 1st terminal tab on 1st terminal tab
* echo the pid of 2nd terminal tab on 2nd terminal tab
Copy the follow to the terminal:
Code:echo pid $$; gnome-terminal --title="TAB-Titel" --tab --active -- bash -c 'echo $$ & echo Hello; read exec bash'How to output the pid from 2nd terminal tab on 1st terminal tab ?
I tryed the follow on 2nd terminal tab:
Code:export pid_of_2nd_term_tab=$$I tryed the follow after than on 1st terminal tab a don't get a output:
Code:echo $pid_of_2nd_term_tabIts looks like its not the right way to export a var from one tab to a other.
Any idea to get the pid of 2nd terminal tab available on 1st terminal tab?
* echo the pid of 1st terminal tab on 1st terminal tab
* echo the pid of 2nd terminal tab on 2nd terminal tab
Copy the follow to the terminal:
Code:echo pid $$; gnome-terminal --title="TAB-Titel" --tab --active -- bash -c 'echo $$ & echo Hello; read exec bash'How to output the pid from 2nd terminal tab on 1st terminal tab ?
I tryed the follow on 2nd terminal tab:
Code:export pid_of_2nd_term_tab=$$I tryed the follow after than on 1st terminal tab a don't get a output:
Code:echo $pid_of_2nd_term_tabIts looks like its not the right way to export a var from one tab to a other.
Any idea to get the pid of 2nd terminal tab available on 1st terminal tab?