Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Backtick and escapes Post 302760049 by Subbeh on Wednesday 23rd of January 2013 10:01:33 AM
Old 01-23-2013
What kind of errors do you get? Try replacing the backticks with $(...code...)
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Help with GNU screen: Backtick and Caption.

I'm trying to get GNU screen to show the output of "uptime" for the host being accessed in the current window, but unfortunately, no matter what window I go in, it shows the uptime for the host I originally launched screen in ("adminhost"). Does anyone know how to get this to update from the... (0 Replies)
Discussion started by: akbar
0 Replies

2. Shell Programming and Scripting

By using awk, how to '(backtick)?

Can I know how to express the '(backtick) in awk?! By typing \' ??? (8 Replies)
Discussion started by: patrick87
8 Replies

3. Shell Programming and Scripting

Awk problem: How to express the backtick(')

For example: I got a list of file end at .txt. I want all of them do the same command like grep '^@' and attached it to a output .sh file. This is the command I type: ls *.txt | awk '{print "grep \' \^\@\' ",$1}' > txt.sh My desired output is when I type the command "more txt.sh " The... (4 Replies)
Discussion started by: patrick87
4 Replies

4. Shell Programming and Scripting

Perl: combine Backtick & system() I/O operation?

Hi - Within perl I want to execute a system command. I want to re-direct all the output from the command to a file (@result = `$cmd`;), but I ALSO want the results to be displayed on the screen (system("$cmd"); The reason is this - if the command completes, I want to process the output. If the... (6 Replies)
Discussion started by: jeffw_00
6 Replies

5. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

6. Shell Programming and Scripting

Perl: Backtick Errors

When trying to use backticks for system commands, is there a way to read the error messages if a command doesn't execute properly? I have no problem getting the results if the command is properly executed. Ex. my @result = `dir`; foreach my $line (@result) { print "Result = $line";... (2 Replies)
Discussion started by: kooshi
2 Replies

7. Shell Programming and Scripting

sed with escapes AND spaces?

It's been covered in lots of places, and I have banged on it for about an hour and I am not making any headway on this particular string. A weather-related web page I want to monitor has text on the screen, but it changes. Right now, the page has "None issued by this office recently." but in 2... (4 Replies)
Discussion started by: Habitual
4 Replies

8. Shell Programming and Scripting

use backtick inside awk

Hello, Can't we use backtick operator inside awk. nawk ' BEGIN { RS=""; FS="\</input\>" } { for(i=1;i<=NF;i++) { if ($i~/\"\"/) { print `grep XYZ $i`; print $i } } } ' test In the following code, I need to print $i and some... (8 Replies)
Discussion started by: shekhar2010us
8 Replies
PTHREAD_MUTEXATTR(3)					     Library Functions Manual					      PTHREAD_MUTEXATTR(3)

NAME
pthread_mutexattr_init, pthread_mutexattr_destroy, pthread_mutexattr_settype, pthread_mutexattr_gettype - mutex creation attributes SYNOPSIS
#include <pthread.h> int pthread_mutexattr_init(pthread_mutexattr_t *attr); int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind); int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind); DESCRIPTION
Mutex attributes can be specified at mutex creation time, by passing a mutex attribute object as second argument to pthread_mutex_init(3). Passing NULL is equivalent to passing a mutex attribute object with all attributes set to their default values. pthread_mutexattr_init initializes the mutex attribute object attr and fills it with default values for the attributes. pthread_mutexattr_destroy destroys a mutex attribute object, which must not be reused until it is reinitialized. pthread_mutexattr_destroy does nothing in the LinuxThreads implementation. LinuxThreads supports only one mutex attribute: the mutex kind, which is either PTHREAD_MUTEX_FAST_NP for ``fast'' mutexes, PTHREAD_MUTEX_RECURSIVE_NP for ``recursive'' mutexes, or PTHREAD_MUTEX_ERRORCHECK_NP for ``error checking'' mutexes. As the NP suffix indicates, this is a non-portable extension to the POSIX standard and should not be employed in portable programs. The mutex kind determines what happens if a thread attempts to lock a mutex it already owns with pthread_mutex_lock(3). If the mutex is of the ``fast'' kind, pthread_mutex_lock(3) simply suspends the calling thread forever. If the mutex is of the ``error checking'' kind, pthread_mutex_lock(3) returns immediately with the error code EDEADLK. If the mutex is of the ``recursive'' kind, the call to pthread_mutex_lock(3) returns immediately with a success return code. The number of times the thread owning the mutex has locked it is recorded in the mutex. The owning thread must call pthread_mutex_unlock(3) the same number of times before the mutex returns to the unlocked state. The default mutex kind is ``fast'', that is, PTHREAD_MUTEX_FAST_NP. pthread_mutexattr_settype sets the mutex kind attribute in attr to the value specified by kind. pthread_mutexattr_gettype retrieves the current value of the mutex kind attribute in attr and stores it in the location pointed to by kind. RETURN VALUE
pthread_mutexattr_init, pthread_mutexattr_destroy and pthread_mutexattr_gettype always return 0. pthread_mutexattr_settype returns 0 on success and a non-zero error code on error. ERRORS
On error, pthread_mutexattr_settype returns the following error code: EINVAL kind is neither PTHREAD_MUTEX_FAST_NP nor PTHREAD_MUTEX_RECURSIVE_NP nor PTHREAD_MUTEX_ERRORCHECK_NP AUTHOR
Xavier Leroy <Xavier.Leroy@inria.fr> SEE ALSO
pthread_mutex_init(3), pthread_mutex_lock(3), pthread_mutex_unlock(3). LinuxThreads PTHREAD_MUTEXATTR(3)
All times are GMT -4. The time now is 11:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy