Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Copy last few lines of a file, perform math operation and iterate further Post 303031218 by RudiC on Sunday 24th of February 2019 04:33:06 AM
Old 02-24-2019
Hi SaPa,


thanks for sharing your working (!) approach.
Pls be aware that it contains elements that were not specified in post #1 and thus could not be covered by the proposals given. Also, running 3 external commands in extra processes, plus 4 file operations (open), for each of the 639 iterations might not be the most efficient usage of resources.


@nezabudka: Thanks for your "exotic" approach, giving me and my aspects / perspective / tool box a new dimension!
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to perform arithmetic operation on date

Hi all, I would appreciate if anyone knows how to perform adding to date. As for normal date, i can easily plus with any number. But when it comes to month end say for example 28 Jun, i need to perform a plus with number 3, it will not return 1 Jul. Thanks in advance for your help. (4 Replies)
Discussion started by: agathaeleanor
4 Replies

2. Emergency UNIX and Linux Support

Logic for file copy operation

Hi, i need to copy contents from source to destination with a few conditions, Please helpme out. Sample input file $>cat testfile.txt /a/b/c/d | /e/f/g/d (d can be either a file or directory) my conditions are: check if destination is valid and if its a file or directory if its a... (5 Replies)
Discussion started by: raghu_shekar
5 Replies

3. Shell Programming and Scripting

Enter third column & Perform Operation

I am trying to enter a third column in this file, but the third column should that I call "Math" perform a some math calculations based on the value found in column #2. Here is the input file: Here is the desired output: Output GERk0203078$ Levir Math Cotete_1... (5 Replies)
Discussion started by: Ernst
5 Replies

4. Shell Programming and Scripting

awk math operation on two files

Hi, I need your help. I've got two files and i need to add 2nd line after occurrence of "Group No X" from data2.txt to 3rd line (after occurrence of "Group No X") from data1.txt. There is the same number of "Groups" in both files and the numbers of groups have the same pattern. data1.txt Group... (2 Replies)
Discussion started by: killerbee
2 Replies

5. Shell Programming and Scripting

[Solved] Perform an operation to all directories

Sorry, about this thread - I solved my own problem! Thanks for taking a look. edit by bakunin: no problem, but it would have been a nice touch to actually tell us what the solution was. This would have been slightlich more educating than just knowing that you found it. I changed your title to... (0 Replies)
Discussion started by: Blue Solo
0 Replies

6. Homework & Coursework Questions

Using dbms_pipe with C++ to perform daabase operation

I am getting two result: string and int in c++ code. That I want to store into database. The request which generates result is very frequent. So each time performing db operation to store the result is costly for me. So how this can be achived using dbms_sql? I dont have any experience and how... (1 Reply)
Discussion started by: karimkhan
1 Replies

7. Shell Programming and Scripting

How To Perform Mathematical Operation Within If in awk?

Hi All, I am using an awk script as below: awk -F'|' 'BEGIN{OFS="|";} { if ($1==$3 && $3==$7 && $7==$13 && $2==$6 && $6==$11 && $15-$14+1==$11) print $0"|""TRUE"; else print $0"|""FALSE"; }' tempfile.txt In above script, all conditions are being checked except the one which is... (4 Replies)
Discussion started by: angshuman
4 Replies

8. Shell Programming and Scripting

awk --> math-operation in a array

Hi main object is categorize the difference of data-values (TLUFT02B - TLUFT12B). herefor i read out data-files which are named acording to the timeformat yyyymmddhhmm. WR030B 266.48 Grad 0 WR050B 271.46 Grad 0 WR120B 268.11 Grad 0 WV030B 2.51 m/s ... (6 Replies)
Discussion started by: IMPe
6 Replies

9. Shell Programming and Scripting

awk --> math-operation in data-record and joining with second file data

Hi! I have a pretty complex job - at least for me! i have two csv-files with meassurement-data: fileA ...... (2 Replies)
Discussion started by: IMPe
2 Replies

10. Shell Programming and Scripting

awk script to find data in three file and perform replace operation

Have three files. Any other approach with regards to file concatenation or splitting, etc is appreciated If column55(billngtype) of file1 contains YMNC or YPBC then pick the value of column13(documentnumber). Now find this documentnumber in column1(Billdoc) of file2 and grep the corresponding... (4 Replies)
Discussion started by: as7951
4 Replies
aio_proc_max(5) 						File Formats Manual						   aio_proc_max(5)

NAME
aio_proc_max - maximum number of async I/O operations that can be queued by any process that uses aio_reap() VALUES
Failsafe Default Allowed values Recommended values DESCRIPTION
This tunable places a limit on the system resources that can be consumed by processes that use aio_reap(2). The limit is enforced at a per-process level to improve scalability as the number of CPUs and processes increases. When this tunable is set to 0, it has no effect. That is, resource usage will be restricted by the other limits provided on HP-UX. (These include and setrlimit(2) with Use of these limits (while keeping at 0) ensures compatibility with POSIX standards and legacy applications. However, most of these other limits are enforced at the system-wide level, and they can in some cases reduce scalability. To solve this problem when compatibility with the other limits is not required, the tunable can be set. When is set to a positive value, it becomes the only tunable limit enforced for processes that use aio_reap(2). Memory-usage limits (e.g. or will NOT be enforced for aio_reap(2) processes when is set. However, processes that use POSIX AIO without aio_reap(2) (i.e. only using standard POSIX interface calls) will continue to have all of the old limits enforced. For sysadmins wishing to obtain the increased scalability of without giving up control of memory limits, the tunable can be set. That tun- able limits the size of each I/O, effectively constraining the total memory usage of all processes that use aio_reap(2) by the quantity: This approach provides full control of system-wide resource usage without depending on explicit system-wide constraints. Note: when is set, processes that use aio_reap(2) can still set process-specific limits with the limit. The minimum of and will be the value that is enforced by the AIO subsystem. However, ALL other rlimits related to AIO will have no effect (i.e. will not be enforced) for aio_reap(2) users when is non-zero. Who Is Expected to Change This Tunable? System administrators that run applications requiring heavy usage of AIO (with aio_reap(2)) to disks or filesystems. Restrictions on Changing This tunable is dynamic. Changes to to this tunable take effect immediately for new processes started after the change. But they do not impact existing running processes. (That is, any process running at the time of tuning will be "grandfathered" in, and will adhere to the value held by this tunable at the time the process was started) When Should the Value of This Tunable Be Raised? should be raised for applications that make heavy usage of AIO with aio_reap(2). What Are the Side Effects of Raising the Value of This Tunable? When raising this tunable from its default of 0 to a positive value, the effects described above will take place. (see However, once this tunable is a positive value, the only effect of raising it further is that more system resources can be used for asynchronous I/Os. When Should the Value of This Tunable Be Lowered? should be lowered when AIO performance is acceptable but there is concern about too many system resources being devoted to AIO. What Are the Side Effects of Lowering the Value of This Tunable? As long as it remains a positive value, lowering the value of this tunable simply decreases the number of I/Os that each process can issue. When this tunable is set to 0, it will cease to have an effect, and the system will enforce only the old system-wide tunables described above (see What Other Tunables Should Be Changed at the Same Time as This One? No additional tunables need to be changed at the same time as this one. However, can optionally be set if there is an interest in limiting memory usage for AIO. In addition, when is set to a positive value, another option is to lower the values of the older system wide limits (such as and This is useful because the older limits will have no impact on aio_reap(2) users, and aio_reap(2) users are expected to consume the majority of system resources. (Leaving less resources for processes governed by the older limits) WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. SEE ALSO
kctune(1M), sam(1M), aio_reap(2), gettune(2), settune(2), setrlimit(2), aio(5), aio_iosize_max(5). aio_max_ops(5), aio_physmem_pct(5). Tunable Kernel Parameters aio_proc_max(5)
All times are GMT -4. The time now is 12:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy