LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-20-2023, 04:09 PM   #1
MTCAT
Member
 
Registered: Jan 2021
Posts: 32

Rep: Reputation: Disabled
Bash script help


Hello, I would like to add the contents/functionality in test.sh to start_logger_TC.sh, but when I've attempted to add the commands in test.sh to start_logger_TC.sh, the added test.sh commands don't work, but when test.sh is run by itself, and start_logger_TC.sh as attached is run by itself, all works fine.

Is there a way to add the commands/functionality inside test.sh into start_logger_TC.sh?

I would like to just run start_logger_TC.sh and force mt_logger to run on one core
and mt_adc to run on the second core (dual core VortexDX3).

Thanks,

David
 
Old 04-20-2023, 04:14 PM   #2
MTCAT
Member
 
Registered: Jan 2021
Posts: 32

Original Poster
Rep: Reputation: Disabled
Screen captures of script files

Sorry, wouldn't let me attach the .sh files, here's screen shots of the script files.

Thanks,

David
Attached Thumbnails
Click image for larger version

Name:	start_logger_TC.JPG
Views:	12
Size:	26.0 KB
ID:	40861   Click image for larger version

Name:	test.JPG
Views:	15
Size:	12.7 KB
ID:	40862  
 
Old 04-20-2023, 09:00 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,147
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Which one is test.sh? Which one is start_logger_TC.sh?
You have 31 posts. You can post code inside of code tags. Although cloudflare has been obnoxious about it lately.

Look at parallel
https://manpages.org/parallel

Also taskset
https://manpages.org/taskset

https://metacpan.org/pod/Sys::CpuAffinity
 
Old 04-20-2023, 09:19 PM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,162

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Taskset from Teckk URL might help.

Try something like this:
Quote:
taskset -c cpu-core-number(s) application
Or check out this one: https://www.maketecheasier.com/assig...taskset-linux/
 
Old 04-21-2023, 09:13 AM   #5
MTCAT
Member
 
Registered: Jan 2021
Posts: 32

Original Poster
Rep: Reputation: Disabled
Hi Teckk,

Thanks for the help, I'll check out those links.

start_logger_TC.sh is the script with the "aterm ........" commands, which starts up a data acquisition program, mt_logger is the GUI part (GLADE) responsible for on screen drawing and user input through the GUI and mt_adc is the "nuts and bolts" of dealing with the data, buffering and writing to disk.

I would like to (automatically) make mt_logger run on 1 core of the VortexDX3 (and stay there), and mt_adc run on the other.

mt_logger is about a 30 percent load on 1 core but w/o the taskset command the two applications flip back and forth between the cores, it seems to help stability of the system overall if the programs are forced to run (and stay) on their own respective cores.

I was hoping/trying to put the taskset commands into start_logger_TC.sh so that on startup, the programs are forced to run and stay on their own cores.

Thanks,

David
 
  


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] Running bash script from another bash script bulletproof.rs Programming 5 12-10-2017 04:22 AM
[SOLVED] BASH Script - What am I doing wrong in this test? - BASH Script BW-userx Programming 34 04-08-2017 01:36 PM
Variables and Mkvextract in a bash script and a good resource for bash help? gohmifune Linux - General 9 04-13-2011 08:37 AM
SSH connection from BASH script stops further BASH script commands tardis1 Linux - Newbie 3 12-06-2010 08:56 AM
Bash script to create bash script jag7720 Programming 10 09-10-2007 07:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:46 AM.

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