Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Editing the alphabet's based on position information Post 302822027 by RudiC on Sunday 16th of June 2013 04:41:12 PM
Old 06-16-2013
Not sure. As F[ ] elements are created when referenced, memory may become exhausted, but then the error msg should complain about memory allocation problems. Try this:
Code:
awk     'NR == FNR      {F[$1]=$2; R[$1]=$3; next}
         FNR > 1        {for (i=1; i<=NF; i++) {
                                 if ($i == F[++CNT]) $i=R[CNT]
                                 delete F[CNT]
                                }
                        }
         1
        ' file2 FS="" OFS="" file1

This User Gave Thanks to RudiC For This Post:
 

8 More Discussions You Might Find Interesting

1. HP-UX

[Solved] processor type and bit information

Hi, I'm trying to download a compatible Oracle Client software for a HP-UX machine. I'd like to know if ... 1) HP-UX is 32 bit or 64 bit? 2) Processor type - Itanium or regular? when I execute uname -a I get HP-UX B.11.11 U 9000/800 728684161 unlimited-user license Based on the... (7 Replies)
Discussion started by: luft
7 Replies

2. Shell Programming and Scripting

Selective position file editing inside folder

I need to process 4 files having name pattern as followis:- 1) Each file starts with = ABCJmdmfbsjop letters + 7 Digit Number _mm-dd-yyyy-hh-mm-ss-3 Digit Number.data where ABCJmdmfbsjop :- is alphabet. Each file starts with this ABCJmdmfbsjop alphabet. 7 Digit Number :- Numeric 7 digits. __:-... (1 Reply)
Discussion started by: lancesunny
1 Replies

3. UNIX for Dummies Questions & Answers

[Solved] Find position of character with awk

Hi Guys! Could anyone help me with?.. I have a line which says BCVGF%6$#900 .....How can we know which position is for % or say $ by command or script?There is any way to get a prompt by any script? Thanks a lot (6 Replies)
Discussion started by: Indra2011
6 Replies

4. Shell Programming and Scripting

[Solved] Array for parameters from 5th position

Hi All, I am writing a script where the first 5 parameters are mandatory but the script should be able to handle a maximum of 9 parameters (with the remainig 4 optional) I would like to load all parameters from 5th parameter positioninto an array. the piece of code I am writing for this:... (0 Replies)
Discussion started by: snailrider
0 Replies

5. Shell Programming and Scripting

[Solved] Need help in editing a script

Hi, I have one script in my cronjob, which is fetching file from a ftp site and making a copy with today's date and time. This is a new setup. There was a instance when test_bill.txt was not present on ftp.xxxx_xxxx.com and when this job ran and did not fetched file, still it send mail of... (5 Replies)
Discussion started by: solaris_1977
5 Replies

6. Shell Programming and Scripting

[Solved] How can I pull specific information from PS?

I need to grab information from the output of the ps command. For each line of ps output that contains _progres -b I need to get the word that follows -p. The "-p" can be anywhere after "_progres -b". Using grep to select the correct lines is no problem (e.g. ps -ef|grep "_progres \-b|grep -v... (3 Replies)
Discussion started by: Papa Lee
3 Replies

7. Shell Programming and Scripting

[Solved] Extracting information from DDL's

Dear Experts, I need your help here. I have lot of teradata DDL's as follows, i want to extract field names , field attributes and NOT NULL information from DDL.Could you please help here. Sample DDL: CREATE MULTISET TABLE APS_CALL_IN_PICKUP_CANCELED ,NO FALLBACK , NO BEFORE... (2 Replies)
Discussion started by: srikanth38
2 Replies

8. Shell Programming and Scripting

Search for a string at a particular position and replace with blank based on position

Hi, I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies
nmadvise(3)						     Library Functions Manual						       nmadvise(3)

NAME
nmadvise - Advise the system of the expected paging behavior of a process (libnuma). SYNOPSIS
#include <numa.h> #include <sys/nman.h> int nmadvise( void *addr, long len, int behav, memalloc_attr_t *attr ); PARAMETERS
The parameters to the nmadvise() function are the same as for madvise(), with the addition of the attr parameter: Points to the starting address of one memory region, or a list of starting addresses and lengths for multiple regions, to which the advice refers. If a positive value, specifies the length, in bytes, of one region starting at the address specified by the addr parameter. If a negative value, specifies that the addr parameter points to an array of regions (an array of starting addresses and their lengths). In this case, -len indicates the number of regions in the array. See the description of the nmemalloc_range_t type in numa_types(4) for more information about the type used for array elements. Specifies the behavior of the region. See DESCRIPTION for details. Points to a structure containing the memory allocation policy and attributes that will be assigned to the region or regions specified by the addr and len parameters. DESCRIPTION
The nmadvise() function permits a process to advise the system about its expected future behavior in referencing a mapped file or shared memory region. The nmadvise() function supports the following flags for the behav parameter, in addition to those documented in madvise(2): Prepare the specified range or object for migration to the memory regions specified by the memory allocation policy attributes. Without this flag, only new allocations occur from the regions specified by the new allocation policy attributes. This flag may be logically ORed with the MADV_CURRENT flag to indicate that the application should wait for migration to occur. Without this flag, the nmadvise() function may return before all of the pages in the range have been migrated or replicated, subject to resource availability. If the requested resources are not available, the function will terminate when the resources are exhausted. See MADV_INSIST. When used in conjunction with MADV_WAIT, when the requested resource is exhausted, the remaining memory will be paged out to the backing store. If, in the structure pointed to by attr, the mattr_policy member is MPOL_DIRECTED and the mattr_rad member is RAD_NONE, the mattr_radset member specifies the set of Resource Affinity Domains (RADs) where the pages of the specified range will be allocated. If the mattr_radset member is NULL, the system will select a RAD for the memory object from among all of the RADs in the caller's parti- tion. In this case, the overflow set will be NULL. If the attr parameter is NULL, any behav flags specific to nmadvise()are ignored, and the function is equivalent to madvise(). NOTES
As with madvise(), the behaviors specified with nmadvise() are considered by the system to be hints, and may in fact, be unimplemented. Unimplemented behaviors will always return success. RETURN VALUES
Success. Failure. In this case, errno is set to indicate the error. ERRORS
If the nmadvise() function fails, it sets errno is set to one of the following values for the reason specified: A non-NULL attr argument points to an invalid address. The behav parameter is invalid. The structure pointed to by the attr argument contains an invalid memory allocation policy, an invalid RAD, or an invalid RAD set. The behav parameter specifies MADV_SPACEAVAIL, and resources cannot be reserved. SEE ALSO
Functions: madvise(2), nmmap(3), numa_intro(3) Files: numa_types(4) nmadvise(3)
All times are GMT -4. The time now is 04:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy