Sponsored Content
Operating Systems AIX really stuck- need to get a variable within a variable- AWK Post 302211149 by jeffpas on Wednesday 2nd of July 2008 04:52:18 PM
Old 07-02-2008
It looks like I also have 'gawk' capability, and can use this instead.
Not sure what the difference is. Seems basically the same.

Last edited by jeffpas; 07-02-2008 at 05:57 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

2. Shell Programming and Scripting

How to define a variable with variable definition is stored in a variable?

Hi all, I have a variable say var1 (output from somewhere, which I can't change)which store something like this: echo $var1 name=fred age=25 address="123 abc" password=pass1234 how can I make the variable $name, $age, $address and $password contain the info? I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies

3. Shell Programming and Scripting

assign awk's variable to shell script's variable?

Dear All, we have a command output which looks like : Total 200 queues in 30000 Kbytes and we're going to get "200" and "30000" for further process. currently, i'm using : numA=echo $OUTPUT | awk '{print $2}' numB=echo $OUTPUT | awk '{print $5}' my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies

4. Shell Programming and Scripting

using awk for setting variable but change the output of this variable within awk

Hi all, Hope someone can help me out here. I have this BASH script (see below) My problem lies with the variable path. The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level. The... (6 Replies)
Discussion started by: Cowardly
6 Replies

5. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

6. Shell Programming and Scripting

[Solved] How to increment and add variable length numbers to a variable in a loop?

Hi All, I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies

7. Shell Programming and Scripting

awk print variable then fields in variable

i have this variable: varT="1--2--3--5" i want to use awk to print field 3 from this variable. i dont want to do the "echo $varT". but here's my awk code: awk -v valA="$varT" "BEGIN {print valA}" this prints the entire line. i feel like i'm so close to getting what i want. i... (4 Replies)
Discussion started by: SkySmart
4 Replies

8. Shell Programming and Scripting

awk variable search and line count between variable-search pattern

Input: |Running the Rsync|Sun Oct 16 22:48:01 BST 2016 |End of the Rsync|Sun Oct 16 22:49:54 BST 2016 |Running the Rsync|Sun Oct 16 22:54:01 BST 2016 |End of the Rsync|Sun Oct 16 22:55:45 BST 2016 |Running the Rsync|Sun Oct 16 23:00:02 BST 2016 |End of the Rsync|Sun Oct 16 23:01:44 BST 2016... (4 Replies)
Discussion started by: busyboy
4 Replies

9. UNIX for Beginners Questions & Answers

How can I assign awk's variable to shell script's variable?

I have the following script, and I want to assign the output ($10 and $5) from awk to N and L: grdinfo data.grd | awk '{print $10,$5}'| read N L output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies

10. UNIX for Beginners Questions & Answers

Grepping for one variable while using awk to parse an associated variable

Im trying to search for a single variable in the first field and from that output use awk to extract out the lines that contain a value less than a value stored in another variable. Both the variables are associated with each other. Any guidance is appreciated. File that contains the... (6 Replies)
Discussion started by: ncwxpanther
6 Replies
CAP_CLEAR(3)						     Linux Programmer's Manual						      CAP_CLEAR(3)

NAME
cap_clear, cap_clear_flag, cap_get_flag, cap_set_flag, cap_compare - capability data object manipulation SYNOPSIS
#include <sys/capability.h> int cap_clear(cap_t cap_p); int cap_clear_flag(cap_t cap_p, cap_flag_t flag); int cap_get_flag(cap_t cap_p, cap_value_t cap, cap_flag_t flag, cap_flag_value_t *value_p); int cap_set_flag(cap_t cap_p, cap_flag_t flag, int ncap, const cap_value_t *caps, cap_flag_value_t value); int cap_compare(cap_t cap_a, cap_t cap_b); Link with -lcap. DESCRIPTION
These functions work on a capability state held in working storage. A cap_t holds information about the capabilities in each of the three sets, Permitted, Inheritable, and Effective. Each capability in a set may be clear (disabled, 0) or set (enabled, 1). These functions work with the following data types: cap_value_t identifies a capability, such as CAP_CHOWN. cap_flag_t identifies one of the three flags associated with a capability (i.e., it identifies one of the three capability sets). Valid values for this type are CAP_EFFECTIVE, CAP_INHERITABLE or CAP_PERMITTED. cap_flag_value_t identifies the setting of a particular capability flag (i.e, the value of a capability in a set). Valid values for this type are CAP_CLEAR (0) or CAP_SET (1). cap_clear() initializes the capability state in working storage identified by cap_p so that all capability flags are cleared. cap_clear_flag() clears all of the capabilities of the specified capability flag, flag. cap_get_flag() obtains the current value of the capability flag, flag, of the capability, cap, from the capability state identified by cap_p and places it in the location pointed to by value_p. cap_set_flag() sets the flag, flag, of each capability in the array caps in the capability state identified by cap_p to value. The argu- ment, ncap, is used to specify the number of capabilities in the array, caps. cap_compare() compares two full capability sets and, in the spirit of memcmp(), returns zero if the two capability sets are identical. A positive return value, status, indicates there is a difference between them. The returned value carries further information about which of three sets, cap_flag_t flag, differ. Specifically, the macro CAP_DIFFERS (status, flag) evaluates to non-zero if the returned status dif- fers in its flag components. RETURN VALUE
cap_clear(), cap_clear_flag(), cap_get_flag() cap_set_flag() and cap_compare() return zero on success, and -1 on failure. Other return val- ues for cap_compare() are described above. On failure, errno is set to EINVAL, indicating that one of the arguments is invalid. CONFORMING TO
These functions are as per the withdrawn POSIX.1e draft specification. cap_clear_flag() and cap_compare() are Linux extensions. SEE ALSO
libcap(3), cap_copy_ext(3), cap_from_text(3), cap_get_file(3), cap_get_proc(3), cap_init(3), capabilities(7) 2008-05-11 CAP_CLEAR(3)
All times are GMT -4. The time now is 09:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy