0

My bash script is as follows:

#!/bin/bash sudo taskset 1 ./program & 

When running it does nothing.

I am able to run the software normally with ./program.

I am attempting to do the behavior of "The default behavior is to run a new command with a given affinity mask"

2
  • 2
    could you explain what you mean with "it does nothing"? What exactly happens, what are you expecting to happen? (and if it's not directly clear from what you write, how these two things differ)CommentedMar 10 at 21:48
  • By the way, I don't believe in your handle here – "WorstCoder4Ever". You ask question. You will get better every single time you do something, you ask something, or try something. We all change, and most of the time it's for the better of ourselves :)CommentedMar 10 at 21:49

1 Answer 1

1

If you want to use taskset in a bash script, you may do so as follows:

#!/usr/bin/bash echo $(taskset -p 1) 

OR; assume following script name is "mysc.sh"

#!/usr/bin/bash cmd="taskset 1 ./program" $cmd & 

And then, from the command line:

$ sudo /path/to/mysc.sh 

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.