Sponsored Content
Full Discussion: Use of AWK as array
Top Forums Shell Programming and Scripting Use of AWK as array Post 302227914 by vidyadhar85 on Friday 22nd of August 2008 07:47:37 AM
Old 08-22-2008
TRE_reset(bts[i],bss[i],"tre[i]")
what is this?? a function??
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Array in awk

Hi, How can find Array is NULL or not. i wrote script using arrays but i want dislpy an message if arrary was Empty. pls help me on this. (2 Replies)
Discussion started by: koti_rama
2 Replies

2. Shell Programming and Scripting

array on awk

I have a raw data file: 70,1,1,-53.25 70,1,1,,,,-57.50 70,1,1,,,,,,,,,,-48.00 I want to have a output file with the formatting below: 70,1,1,-53.25,,,,-57.50,,,,,-48.00 I mean if these rows have the first similar three variables which will be group into one row. And I try to write a... (1 Reply)
Discussion started by: anhtt
1 Replies

3. Shell Programming and Scripting

AWK help. how to compare a variable with a data array in AWK?

Hi all, i have a data array as follows. array=ertfgj2345 array=456ttygkd . . . array=errdjt3235 so number or elements in the array can varies depending on how big the data input is. now i have a variable, and it is $1 (there are $2, $3 and so on, i am only interested in $1). ... (9 Replies)
Discussion started by: usustarr
9 Replies

4. Shell Programming and Scripting

array in awk

Hi I am trying to get data from an array and input it into awk. Please see below: ### #!/bin/bash #declare array declare -a ARRAY exec 10</path/to/arrayfile let count=0 while read LINE <&10; do ARRAY=$LINE ((count++)) done #close file exec 10>&- ENDLOOP=0 (10 Replies)
Discussion started by: rocket_dog
10 Replies

5. Shell Programming and Scripting

array in awk

hi, can somebody explain me this? probably i am overlooking something but i dont know what why is not printed "7 9 11" instead of this? $ echo "" | awk '{for(i=1;i<=3;i++){j=7;a=j;j=j+2;} print a,a,a; }' 7 7 7thanks (2 Replies)
Discussion started by: erik80
2 Replies

6. Shell Programming and Scripting

HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?

Hello experts, I'm stuck with this script for three days now. Here's what i need. I need to split a large delimited (,) file into 2 files based on the value present in the last field. Samp: Something.csv bca,adc,asdf,123,12C bca,adc,asdf,123,13C def,adc,asdf,123,12A I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies

7. Shell Programming and Scripting

Array from awk

I'm trying to get the output from awk into a bash array. Here is my script. #!/bin/bash while : do app=$( osascript -e "tell application \"System Events\" to return name of every process whose frontmost is true" ) echo "$app" if ava ]] then ps -ax | grep -v awk | pids=( $(awk... (5 Replies)
Discussion started by: nextyoyoma
5 Replies

8. Shell Programming and Scripting

How to Assign an shell array to awk array?

Hello All, Can you please help me with the below. #!/bin/bash ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1" ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies

9. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies

10. UNIX for Beginners Questions & Answers

awk array

Hello. I'm trying to figure out which one of these is not true about an awk array. -You do not need to formally declare an array; it is created automatically on first assignment -Array elements can only be addressed using an index ... (1 Reply)
Discussion started by: Eric7giants
1 Replies
st_obj_calls(3) 					     Library Functions Manual						   st_obj_calls(3)

NAME
st_is_obj_call_shared, st_is_obj_shared, st_is_obj_stripped, st_obj_name, st_obj_text_start, st_obj_text_size, st_obj_data_start, st_obj_data_size, st_obj_bss_start, st_obj_bss_size, st_obj_mem_addr - General calls for accessing information about an object file. LIBRARY
Symbol Table and Object File Access Library (libst.a) SYNOPSIS
#include <st.h> st_status_t st_is_obj_call_shared ( st_obj_t *obj, st_bool_t *cs); st_status_t st_is_obj_shared ( st_obj_t *obj, st_bool_t *shared); st_status_t st_is_obj_stripped ( st_obj_t *obj, st_bool_t *stripped); st_status_t st_obj_name ( st_obj_t *obj, char **name); st_status_t st_obj_text_start ( st_obj_t *obj, st_addr_t *text); st_status_t st_obj_text_size ( st_obj_t *obj, unsigned long *tsize); st_status_t st_obj_data_start ( st_obj_t *obj, st_addr_t *data); st_status_t st_obj_data_size ( st_obj_t *obj, unsigned long *dsize); st_status_t st_obj_bss_start ( st_obj_t *obj, st_addr_t *bss); st_status_t st_obj_bss_size ( st_obj_t *obj, unsigned long *bsize); st_status_t st_obj_mem_addr ( st_obj_t *obj, st_addr_t file_addr, st_addr_t *mem_addr); PARAMETERS
Specifies an object handle, as returned by the st_obj_open function. Specifies the address to which st_is_obj_call_shared returns a Bool- ean value of TRUE if the specified object is call-shared or FALSE if it is a nonshared or shared library. Specifies the address to which st_is_obj_shared returns a Boolean value of TRUE if the specified object is a shared library (that is, a file with an .so suffix) or FALSE if it is a call-shared or nonshared object. Specifies the address to which st_is_obj_stripped returns a Boolean value of TRUE if the sym- bol table has been stripped from the specified object. Specifies the address to which st_obj_name returns a pointer to the null-terminated string of the object name specified in a prior st_obj_open call for the specified object. Specifies the address to which st_obj_text_start returns the starting address of the object's text segment as it would reside in memory when the object is executing. Specifies the address to which st_obj_text_size returns the size of the specified object's text segment. Specifies the address to which st_obj_data_start returns the starting address of the specified object's data segment as it would reside in memory when the object is executing. Specifies the address to which st_obj_data_size returns the size of the specified object's data segment. Specifies the address to which st_obj_bss_start returns the starting address of the specified object's bss segment as it would reside in memory when the object is execut- ing. Specifies the address to which st_obj_bss_size returns size of the specified object's bss segment. Specifies an address in the spec- ified object file. st_obj_mem_addr translates this address to the equivalent address in memory to which libst has read the file. Speci- fies the address to which st_obj_mem_addr writes the address to which libst has read the file indicated by file_addr. DESCRIPTION
These routines return information about an object. Determine whether the specified object is a call-shared object, a nonshared object, or a shared library. Determines whether the symbol table has been stripped from the specified object. Returns the null-terminated string that was specified as the object's name in a prior call to st_obj_open for the specified object. Returns the starting address of the spec- ified object's text segment as it would reside in memory when the object is executing. You can use the st_obj_mem_addr function to trans- late text addresses for the executable to the address in memory to which libst has loaded a copy of the file. Returns the size of the specified object's text segment. Returns the size of the specified object's data segment. Returns the starting address of the specified object's data segment as it would reside in memory when the object is executing. You can use the st_obj_mem_addr function to translate data addresses for the executable to the address in memory to which libst has loaded a copy of the file. Returns the starting address of the specified object's bss segment as it would reside in memory when the object is executing. Because no space is allocated in the on-disk object file for the bss segment, you cannot translate the bss segment addresses using st_obj_mem_addr as you can use the function to trans- late text and data addresses. Returns the size that the specified object's bss segment would have in the executing object. Translates an address from the specified object file to the equivalent address in memory to which libst has read the file. You can then access the text and initialized data segments of a program. You cannot access the bss segments and heap because the object is not executing. RETURN VALUES
All functions indicate success by returning a value of 0 (zero). A positive return value is an errno value from a system call. A negative return value is a library error or informational code. The library codes are documented in st.h. Return parameters are set to 0 or -1 when an error occurs. Address parameters are set to 0 while file and procedure handles are set to -1. An exception to this is if a NULL pointer for the object or other return parameter is input. In these cases, the return parameters will be unchanged. A non-zero return status is the recommended method for detecting an error return from a libst function. FILES
header file that contains all definitions and function prototypes for libst.a functions RELATED INFORMATION
Commands: atom(1) Functions: libst_intro(3), st_addr_to_file(3), st_file_lang(3), st_obj_file_start(3), st_obj_open(3), st_objlist_append(3), st_proc_addr(3), st_sym_value(3) delim off st_obj_calls(3)
All times are GMT -4. The time now is 04:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy