It never gets to "i was here"
i'm trying to get the process ID so I can check if it is running then relaunch it...right now it just doesn't launch anything. and for the daemon part, I am aware that it's not reall daemonesk but I want to be able to stop it
Hi,
I am new to this forum and unix too. I have just started learning unix. As I was going through the first chapter, I read that unix is multitasking, multiprogramming, multiprocessing and multiuser OS.
My question is: Is there any difference between a TASK and a PROCESS. How are PROCESS... (2 Replies)
I have a file contains
TASK gsnmpproxy {
CommandLine = $SMCHOME/bin/gsnmpProxy.exe
}
TASK gsnmpdbgui {
CommandLine = $SMCHOME/bin/gsnmpdbgui.exe
I would like to comment and than uncomment specific task eg TASK gsnmpproxy
Pls suggest how to do in shell script (9 Replies)
I have an task definition listing xml file that contains a list of tasks such as
<TASKLIST
<TASK definition="Completion date" id="Taskname1" Some other
<CODE name="Code12"
<Parameter pname="Dog" input="5.6" units="feet" etc /Parameter>
<Parameter... (3 Replies)
I need to automate a manual task using shell scripting. The scenario is like :-
#!/usr/bin/sh
echo "please enter the name of the lab server to test ..."
read s
ssh $s
This is peace of the script which will allow me to login to another server using "ssh". I have a conf file which is having... (4 Replies)
Hi all,
I'm newbie and stuck here. Thanks for any help.
Input(txt file)
a b X
c d Y
e f Z
g h W
Requested output:
a b X Y
c d Y X
e f Z W
g h W Z
Please use code tags when posting data and code samples! (10 Replies)
Hi experts,
I have a problem with the below shell task:
I need to modify the file creatin a paired row , per each row
which matches filter (e.g. number of nonempty columns = 5)
Output should look like this:
second row is original one from the input,
first row(red) is pairing row, it's... (29 Replies)
Dear all,
I'm a newbie in programming and I would like to know if it is possible to parallelize the script:
for l in {1..1000}
do
cut -f$l quase2 |tr "\n" "," |sed 's/$/\
/g' |sed '/^$/d' >a_$l.t
done
I tried:
for l in {1..1000}
do
cut -f$l quase2 |tr "\n" "," |sed 's/$/\
/g' |sed... (7 Replies)
I have a simple task for my school work. I'm new with unix, so i need help.
I need to write a scenario. Task is. From created txt file read first 3 words and create a 3 catalogs with those 3 words. 2 of those new catalogs should be transferred to other directory. If someone could help me just... (1 Reply)
Hi i have recently started learning Bash scripting to learn a new skill.
My boss has assigned me a task but i am struggling to complete it would really be thankful for some help ill put what i have so far:
Test1-bible is the directory and each chapter of the bible is a sub-directory hence i... (1 Reply)
Discussion started by: Atreus20
1 Replies
LEARN ABOUT OSF1
bind_to_cpu
bind_to_cpu(3) Library Functions Manual bind_to_cpu(3)NAME
bind_to_cpu - Bind execution to a specific CPU.
LIBRARY
Mach Library (libmach.a)
SYNOPSIS
#include <sys/types.h> #include <sys/resource.h>
int bind_to_cpu(
pid_t pid,
unsigned long cpu_mask ,
unsigned long flag );
PARAMETERS
Specifies the target pid. You must have access rights to the pid. Specifies the CPU on which the thread should run. The target CPU is the
bit index in the mask. If you set more than one bit, an error is generated. A cpu_mask of zero clears any previously set CPU binding.
Specifies options to CPU binding. Currently only the option BIND_NO_INHERIT is supported. When set, this option causes child processes
and threads to not inherit the CPU binding.
DESCRIPTION
Upon return from bind_to_cpu, all threads of the target pid are running on the target CPU. Bound threads are not eligible for execution on
any other CPU. You release CPU binding by invoking bind_to_cpu with a cpu_mask of zero.
EXAMPLES
/*
* Fork child process and force it to run on cpu number 3.
* Processes created by the forked child will not inherit bindings.
*/ #include <sys/resource.h> #include <sys/sysinfo.h> #include <sys/signal.h> #include <sys/types.h>
#define CPU_3 0x8 /* Bit 3 set */
main() {
pid_t pid;
if (pid = fork()) { /* parent */
if (bind_to_cpu(pid, CPU_3, BIND_NO_INHERIT)) {
kill(pid, SIGKILL);
exit(1); /* bind_to_cpu() will print error msg */
}
sleep(2); /* wait for child to print CPU */
}
else { /* child */
long cpu_num;
sleep(1); /* wait for parent to bind CPU */
getsysinfo(GSI_CURRENT_CPU, &cpu_num, 0L, 0L, 0L);
printf("child running on CPU %d
", cpu_num);
} }
In this example, the CPU_3 symbol is defined so that bit three in the bit mask is set. When the pid returned from the fork routine identi-
fies the parent routine, the bind_to_cpu routine is called. This routine binds the child process to CPU number three, as specified in the
CPU_3 symbol. When the pid returned from the fork routine identifies the child routine, the child routine sleeps to give the parent routine
time to set its CPU binding. Then it uses the getsysinfo call to determine its CPU and displays its CPU with the printf routine.
If the return value from the bind_to_cpu routine indicates an error, the parent process kills the child process and exits with an error
status.
RETURN VALUES
Upon successful completion, bind_to_cpu returns zero. Upon error, a -1 is returned.
RELATED INFORMATION
Commands: runon(1)
Functions: getsysinfo(2) delim off
bind_to_cpu(3)