Sponsored Content
Top Forums Shell Programming and Scripting awk command - not a valid identifier message Post 302554591 by venhart on Monday 12th of September 2011 12:03:03 PM
Old 09-12-2011
thank you, now if my line is this below
Code:
 
com.data.ara.reportserver.tools.sch_reports.ReportRunner.num_threads=5

how would I do this ?

Last edited by vbe; 09-12-2011 at 01:11 PM.. Reason: code tags!!! You have been warned...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

pwd: A specified flag is not valid for this command.

Probably a very straight forward question but please be easy on me, I am v. new to UNIX! A script that I have runs the line tmp=`pwd -H` It works fine, but I needed to make a couple of other changes to the script, nowhere near this line but now this line reports: pwd: A specified flag... (2 Replies)
Discussion started by: Paxton
2 Replies

2. UNIX for Dummies Questions & Answers

SED or AWK: Appending a line Identifier that changes with paragraph?

Have another question that has been eluding me all day. I have data file I'm trying to reformat so that each line is appended with an ID code, but the ID code needs to update as it searches through the file. I.e. ----Begin Original Datafile----- Condition = XXX Header Line 1 Header... (1 Reply)
Discussion started by: selkirk
1 Replies

3. Shell Programming and Scripting

Help regarding Error message: A test command parameter is not valid

Hi I am getting few messages when trying to run my script from the following lines in the script if test then // SomeCode fi The messages are as follows: testing.sh: OBLIGOR_GROUP_ID: 0403-012 A test command parameter is not valid. testing.sh:... (5 Replies)
Discussion started by: skyineyes
5 Replies

4. Shell Programming and Scripting

': not a valid identifier

I am trying to write a bash script. I am able to do simple things like pass arguments, assign variables and echo the results. However, when I try to declare and array or anything a little more complicated I get ': not a valid identifier Here is my code so far: #!/bin/bash echo start t... (7 Replies)
Discussion started by: script123
7 Replies

5. Shell Programming and Scripting

how to judge wether a url is valid or not using awk

rt 3ks:confused: (6 Replies)
Discussion started by: rainboisterous
6 Replies

6. Shell Programming and Scripting

Whether a string is a valid unix command

How to find a string which is entered in command promt is a valid unix command or not?. Thanks in advance ~Saravana (2 Replies)
Discussion started by: tsaravanan
2 Replies

7. Shell Programming and Scripting

A test command parameter is not valid

Hello, Getting error "A test command parameter is not valid" when trying to run the code below under /sbin/sh AA = "12:00" CHK=$(date +"%H:%M") if then print "Yes" fi Getting 2 errors: 1) "AA: not found" 2) "Specify a parameter with this command" Thanks, IS Please... (5 Replies)
Discussion started by: schureki
5 Replies

8. Shell Programming and Scripting

Using awk to determine if field value is valid

Hi Forum. I tried to search the forum posts for an answer but I haven't been able to do so for what I'm trying to accomplish. I have the following source file: 11936385~TFSA|11936385|4431|3401458067|10/09/1982|25.00|IBSBONUS|3200|||||CASH| 3401458067|1005|... (3 Replies)
Discussion started by: pchang
3 Replies

9. Shell Programming and Scripting

0403-009 The specified number is not valid for this command

Hi, Am using a if condition to match a pattern but I get the following error.. if then echo "The value is $hidType" return 0 elseif -a ] echo "The value is $hidType" return 0 fi I get the following error + echo The value is mode The value is mode + ./a2: mode:... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

10. Shell Programming and Scripting

[BASH] (own) command is not a valid identifier

Heya fellows Yes, script-tools and TUI are both my 'children', so i cant go anywhere (else) and ask for help/bugfixes as i need to write them myself. However i do need help to understand error messages at times (or get hints what else might cause them), so here we go: Since my new computer... (4 Replies)
Discussion started by: sea
4 Replies
thr_keycreate(3C)														 thr_keycreate(3C)

NAME
thr_keycreate, thr_setspecific, thr_getspecific - thread-specific data functions SYNOPSIS
cc -mt [ flag... ] file...[ library... ] #include <thread.h> int thr_keycreate(thread_key_t *keyp, void (*destructor)(void *)); int thr_setspecific(thread_key_t key, void *value); int thr_getspecific(thread_key_t key, void **valuep); Create Key In general, thread key creation allocates a key that locates data specific to each thread in the process. The key is global to all threads in the process, which allows each thread to bind a value to the key once the key has been created. The key independently maintains specific values for each binding thread. The thr_keycreate() function allocates a global key namespace, pointed to by keyp, that is visible to all threads in the process. Each thread is initially bound to a private element of this key, which allows access to its thread-specific data. Upon key creation, a new key is assigned the value NULL for all active threads. Additionally, upon thread creation, all previously created keys in the new thread are assigned the value NULL. Optionally, a destructor function destructor can be associated with each key. Upon thread exit, if a key has a non-null destructor func- tion and the thread has a non-null value associated with that key, the destructor function is called with the current associated value. If more than one destructor exists for a thread when it exits, the order of destructor calls is unspecified. Set Value Once a key has been created, each thread can bind a new value to the key using thr_setspecific(). The values are unique to the binding thread and are individually maintained. These values continue for the life of the calling thread. Proper synchronization of key storage and access must be ensured by the caller. The value argument to thr_setspecific() is generally a pointer to a block of dynamically allocated memory reserved by the calling thread for its own use. See EXAMPLES below. At thread exit, the destructor function, which is associated at time of creation, is called and it uses the specific key value as its sole argument. Get Value thr_getspecific() stores the current value bound to key for the calling thread into the location pointed to by valuep. If successful, thr_keycreate(), thr_setspecific() and thr_getspecific() return 0. Otherwise, an error number is returned to indicate the error. If the following conditions occur, thr_keycreate() returns the corresponding error number: EAGAIN The system lacked the necessary resources to create another thread-specific data key. ENOMEM Insufficient memory exists to create the key. If the following conditions occur, thr_keycreate() and thr_setspecific() return the corresponding error number: ENOMEM Insufficient memory exists to associate the value with the key. The thr_setspecific() function returns the corresponding error number: EINVAL The key value is invalid. Example 1: Call the thread-specific data from more than one thread without special initialization. In this example, the thread-specific data in this function can be called from more than one thread without special initialization. For each argument passed to the executable, a thread is created and privately bound to the string-value of that argument. /* cc -mt thisfile.c */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <thread.h> void *thread_specific_data(void *); void cleanup(void*); #define MAX_ARGC 20 thread_t tid[MAX_ARGC]; int num_threads; int main(int argc, char *argv[]) { int i; num_threads = argc - 1; for (i = 0; i < num_threads; i++) thr_create(NULL, 0, thread_specific_data, argv[i+1], 0, &tid[i]); for (i = 0; i < num_threads; i++) thr_join(tid[i], NULL, NULL); return(0); } /* end main */ void * thread_specific_data(void *arg) { static mutex_t keylock; /* static ensures only one copy of keylock */ static thread_key_t key; static int once_per_keyname = 0; char *private_data = arg; void *tsd = NULL; void *data; if (!once_per_keyname) { mutex_lock(&keylock); if (!once_per_keyname) { thr_keycreate(&key, cleanup); once_per_keyname++; } mutex_unlock(&keylock); } thr_getspecific(key, &tsd); if (tsd == NULL) { data = malloc(strlen(private_data) + 1); strcpy(data, private_data); thr_setspecific(key, data); thr_getspecific(key, &tsd); } printf("tsd for %d = %s ", thr_self(), (char *)tsd); thr_getspecific(key, &tsd); printf("tsd for %d remains %s ", thr_self(), (char *)tsd); return (NULL); } /* end thread_specific_data */ void cleanup(void *v) { /* application-specific clean-up function */ free(v); } See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ thr_exit(3C), attributes(5), standards(5) WARNINGS
The thr_getspecific() and thr_getspecific() functions can be called either explicitly or implicitly from a thread-specific data destructor function. Calling thr_setspecific() from a destructor can result in lost storage or infinite loops. 1 Sep 2005 thr_keycreate(3C)
All times are GMT -4. The time now is 02:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy