Probably a simple one.
Basically I am retrieving a number from a file - setting a variable against it and then incrementing this by 1 and using this as an entry number in a log file for messages. I need the variable to re-evalute itself each time I call it so I get the latest number in the file -... (1 Reply)
I have variables:
FOO="Text"
BAR="FOO"
I'd like to be able to evaluate the variable named as the value of $BAR.
echo $FOO
Text
echo $BAR
FOO
This is what I'd like to do:
echo ${$BAR} (this won't work)
Text (3 Replies)
Hello,
I have this:
#!/usr/bin/ksh
V1=ABC
str="hello 123;${V1}"
eval "echo $str"
i get
hello 123
/script.sh ABC not found
However eval works if $str variable doesn't contain a semicolumn (eg if str="hello 123~${v1}"
running the eval statement above would produce (2 Replies)
hi,
i'm reading a file "LISTE_FILE" like :
#
$LOGCOM * 5
$PRCCOM * 10
and i want to use the file with "while" and having the fields splitted into new variables for treatment :
while read LINE
do
# Ignorer les commentaires un # en premiere position
if
then... (3 Replies)
How to evaluate the value of a variable ?
For example:
a=var
$a=value !!!error happens!!!
I want to evaluate var=value, how to realize it?
Thanks!
---------- Post updated at 03:37 AM ---------- Previous update was at 02:22 AM ----------
I am using linux bash.
a=var
$a=value... (4 Replies)
I'm writing a script to merge the xkcd webcomic tiles for comic 1110. So far, I have written about 100 lines, and instead of doing each quadrant of the image separately, I've decided to use functions to do this, repeating for every quadrant and using variables for each quadrant to make the function... (9 Replies)
Hi
i tried to execute a below script but it is giving execution error
rec=ABC,1234,55.00
Colno=2
coldel=,
fd='"'$coldel'"'
fprint="'"'{print$'$colno'}'"'"
colsyn=`echo "echo "$rec "| awk -F"$fd $fprint`
echo column syntax is $colsyn
colrec=`colsyn`
echo column is $colrec (5 Replies)
Hi,
I am trying to set a variable that has time the format desired. And my intention is to echo variable (instead of actual date command) everytime I like to echo date. Please take a look at below code.
$NOW=''
echo $NOW
After 5 minutes
$echo $NOW
Issue here is , I am not... (2 Replies)
I want to create a conditional expression string and pass in an awk script. My script is as below...
comm="\$3 == "hello""
awk -F "^T" -v command="${comm}" ' {
if ( command ) { print "hye" }
}' testBut the statement "if ( command )" always evaluates to true which is not... (5 Replies)
I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date.
Below command is used for this purpose:
cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | \
nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8)... (1 Reply)
Discussion started by: dia
1 Replies
LEARN ABOUT REDHAT
pthread_setschedparam
PTHREAD_SETSCHEDPARAM(3) Library Functions Manual PTHREAD_SETSCHEDPARAM(3)NAME
pthread_setschedparam, pthread_getschedparam - control thread scheduling parameters
SYNOPSIS
#include <pthread.h>
int pthread_setschedparam(pthread_t target_thread, int policy, const struct sched_param *param);
int pthread_getschedparam(pthread_t target_thread, int *policy, struct sched_param *param);
DESCRIPTION
pthread_setschedparam sets the scheduling parameters for the thread target_thread as indicated by policy and param. policy can be either
SCHED_OTHER (regular, non-realtime scheduling), SCHED_RR (realtime, round-robin) or SCHED_FIFO (realtime, first-in first-out). param spec-
ifies the scheduling priority for the two realtime policies. See sched_setpolicy(2) for more information on scheduling policies.
The realtime scheduling policies SCHED_RR and SCHED_FIFO are available only to processes with superuser privileges.
pthread_getschedparam retrieves the scheduling policy and scheduling parameters for the thread target_thread and store them in the loca-
tions pointed to by policy and param, respectively.
RETURN VALUE
pthread_setschedparam and pthread_getschedparam return 0 on success and a non-zero error code on error.
ERRORS
On error, pthread_setschedparam returns the following error codes:
EINVAL policy is not one of SCHED_OTHER, SCHED_RR, SCHED_FIFO
EINVAL the priority value specified by param is not valid for the specified policy
EPERM the calling process does not have superuser permissions
ESRCH the target_thread is invalid or has already terminated
EFAULT param points outside the process memory space
On error, pthread_getschedparam returns the following error codes:
ESRCH the target_thread is invalid or has already terminated
EFAULT policy or param point outside the process memory space
AUTHOR
Xavier Leroy <Xavier.Leroy@inria.fr>
SEE ALSO sched_setscheduler(2), sched_getscheduler(2), sched_getparam(2), pthread_attr_setschedpolicy(3), pthread_attr_setschedparam(3).
LinuxThreads PTHREAD_SETSCHEDPARAM(3)