LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-09-2020, 12:07 PM   #1
jefsa
Member
 
Registered: Mar 2012
Posts: 83
Blog Entries: 1

Rep: Reputation: Disabled
Bash scripting to determine between two terminals which one is in control.


Hello,

OS is Slackware 14.1

I am using bash scripts to communicate between two terminals and running scripts.

What command(s) can I use to tell which terminal is in control.

The goal is to let the other terminal, not in control, know that the other has executed the
loading of a configuration. Using this information it can then update its files two match
the one in control.

Thanks.

jefsa
 
Old 12-09-2020, 12:59 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
Or write a script that runs something in a subshell, return when it's done, and continue on. Variables won't exist in another subshell. You can have a variable in the parent process.

https://stackoverflow.com/questions/...ble-by-scripts
https://unix.stackexchange.com/quest...-shell-scripts
 
Old 12-09-2020, 02:07 PM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Quote:
Originally Posted by jefsa View Post
What command(s) can I use to tell which terminal is in control.
Could you please explain what do you mean?
 
Old 12-09-2020, 02:26 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by NevemTeve View Post
Could you please explain what do you mean?
I was similarly flabbergasted but didn't dare to voice it; in any case, please OP, explain in full detail what problem you are trying to solve and not what you think might be a solution: https://xyproblem.info/
 
Old 12-09-2020, 05:16 PM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,224

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Named pipes?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] all terminals (and only terminals) in xorg loading SLOWLY after upgrade (wheezy) pepperdreamteam Debian 2 02-03-2013 01:30 PM
Terminals in bash scripting Completely Clueless Linux - General 6 08-24-2010 08:10 PM
USB problem on linux terminals vie NComputing X300 terminals Aleks` Linux - General 1 12-04-2008 05:39 PM
Terminals - spying on local terminals with ssh BeatRyder Linux - Software 5 10-21-2004 01:47 AM
Two monitors, two terminals? Dave Skywatcher Linux - General 3 03-07-2003 02:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration