#!/bin/bash
#获取进程/user/app的pid
pid=ps -aux | grep "[0-9] /user/app\b"| awk -F' ' '{print $2}'
echo “process/user/app pid = $pid”
#获取SPID 4个
spid_1=ps -T -p 605 | grep spid_name | awk -F' ' '{print $2}'
spid_2=ps -T -p 605 | grep spid_name2 | awk -F' ' '{print $2}'
spid_3=ps -T -p 605 | grep spid_name3 | awk -F' ' '{print $2}'
spid_4=ps -T -p 605 | grep spid_name4 | awk -F' ' '{print $2}'
echo "spid_name = $spid_1 "
echo "spid_name2 = $spid_2 "
echo "spid_name3 = $spid_3 "
echo "spid_name3 = $spid_4 "
#taskset
taskset -cp 3,4,5,6,7 $spid_1
taskset -cp 3,4,5,6,7 $spid_2
taskset -cp 3,4,5,6,7 $spid_3
taskset -cp 3,4,5,6,7 $spid_4
echo ‘run taskset’