Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to pass cat file in awk statement? Post 302941511 by Don Cragun on Thursday 16th of April 2015 02:36:48 PM
Old 04-16-2015
Quote:
Originally Posted by stew
Thank you Smilie It worked. I guess get line should be "getline"
Yes. I apologize. I installed a security update to my browser last weekend, and the spell checker is apparently much more aggressive at fixing (supposed) mistakes (even after I have told it not to change something I typed). For some reason it thought it should change shmmax to shammy and when I went back in to fix that, it silently also changed getline to get line. I'm going to have to watch it more closely (or disable it).

It looks like RudiC's suggestion was also mangled by something... The line he suggested:
Code:
/^kernel.printk/        {$3 = shmmax

should be:
Code:
/^kernel.shmmax/        {$3 = shmmax

This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I can't seem to pass variables properly into a nawk statement

Ok, So up front I'm going to say that I'm a very elementary scripter, and I tend to use tools I don't fully understand, but I shotgun at something until I can get it to work...that said, I can't for the life of me understand why I can't get this to go down the way I want it to. The goal: -to... (6 Replies)
Discussion started by: DeCoTwc
6 Replies

2. Shell Programming and Scripting

How to pass parameters to an awk file?

I have an awk file where I need to pass a filename and a value as a parameter from a sh script. I need to know how to pass those values in the sh script and how to use the same in the awk file. Thanks in advance!!! Geetha (3 Replies)
Discussion started by: iamgeethuj
3 Replies

3. Shell Programming and Scripting

want to pass sentence with SED and CAT

I have to pass a sentence in a file, the specs are as: cat run | sed 's/SRT/'$8'/g' | sed 's/plength/68/g' | sed 's/stcol/'$5'/g' | sed 's/encol/'$6'/g' | sed 's/brdtype/'$1'/g' | sed 's/brdtxt/'$3'/g' | sed 's/demotxt/Total '$2'/g' | sed 's/bantxt/ban_'$7'/g' | sed 's/validcodes/'$4'/g' > runx... (1 Reply)
Discussion started by: patilrakesh1984
1 Replies

4. Shell Programming and Scripting

how to pass a variable to an update sql statement inside a loop

hi all, i am experiencing an error which i think an incorrect syntax for the where clause passing a variable was given. under is my code. sqlplus -s ${USERNAME}/${PASSWORD}@${SID} << END1 >> $LOGFILE whenever sqlerror exit set serveroutput on size 1000000 declare l_rc ... (0 Replies)
Discussion started by: ryukishin_17
0 Replies

5. Shell Programming and Scripting

Pass a DDL statement to a KSH script

I need to pass a DDL statement into a ksh script & parse the statement. What is the best way to pass a DDL statement into a KSH script. ---------- Post updated at 09:28 AM ---------- Previous update was at 07:35 AM ---------- if the name of the script is test.ksh test.ksh "ALTER TABLE... (12 Replies)
Discussion started by: gayathree
12 Replies

6. Shell Programming and Scripting

How to pass tablenames from a file to shell script to execute create statement in DB2

Hi, I am new to Shell Scripting, and I need to create nicknames for 600 tables in db2. I have the file names in a text file and i have to pass these table names to a shell script create nicknames in db2. Can some one please help me in this regard. (1 Reply)
Discussion started by: kamalanaatha
1 Replies

7. Shell Programming and Scripting

Pass values to case statement in a function korn shell

I'm in the process of writng a function that consists of a case statement is there a way of calling the function and passing a value to it? ie function1 () { case opt1 do ..... opt2 do..... esac } function opt1 I'm aware the syntax is not correct, but you get the general idea. (1 Reply)
Discussion started by: squrcles
1 Replies

8. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies

9. Shell Programming and Scripting

Cat a script, pipe it, then pass arguments to it?

suppose i have a perl script that is normally run this way: ./checkdisk.pl -H hostname -w 40 -c 80 but, for whatever reason, i cannot run the script directly as it should. But i can cat it through pipe. How can i pass the arguments "-H hostname -w 40 -c 80"? so this is what i'm doing,... (6 Replies)
Discussion started by: SkySmart
6 Replies

10. Shell Programming and Scripting

Need to add prefix using sed or awk from cat the file

I need the use sed or AWK using cat the file Node1 TDEV RW 1035788 TDEV RW 1035788 Server1 TDEV RW 69053 Server2 TDEV RW 69053 TDEV RW 103579 Server3 TDEV RW 69053 server4 RDF1+TDEV RW 69053 RDF1+TDEV RW 517894 RDF1+TDEV RW 621473 server6 TDEV RW 34526 TDEV RW 34526 (22 Replies)
Discussion started by: ranjancom2000
22 Replies
shmmni(5)							File Formats Manual							 shmmni(5)

NAME
shmmni - number of System V shared memory segment identifiers in the system VALUES
Default Allowed values DESCRIPTION
Shared memory is an efficient InterProcess Communications (IPC) mechanism. One process creates a shared memory segment and attaches it to its address space. Any processes looking to communicate with this process through the shared memory segment then attach the shared memory segment to their corresponding address spaces as well. Once attached, a process can read from or write to the segment depending on the permissions specified while attaching it. This tunable effectively sets the number of unique segments creatable system wide, since each segment is assigned an identifier by the ker- nel. The identifier is simply a reference generated by the kernel such that any user process can request a particular segment for sharing with a simple integer, and let the kernel determine which segment this corresponds to. Who is Expected to Change This Tunable? Anyone. Restrictions on Changing Changes to this tunable take effect immediately. Attempting to lower below the current number of identifiers in use or below the current value of will result in an error message. Attempts to raise the value of when insufficient memory is available to the kernel to create the needed structures will result in an error message. When Should the Value of This Tunable Be Raised? should be raised if users of System V shared memory are receiving the error message on calls. What Are the Side Effects of Raising the Value? Kernel memory usage will be slightly increased, as the data structures used to track the segments are allocated based on this tunable. When Should the Value of This Tunable Be Lowered? If kernel memory is at a premium, or it is known that few segments will be needed, a slight savings can be gained from decreasing this tun- able, and thus decreasing the data structure memory usage associated with it. What Are the Side Effects of Lowering the Value? Kernel memory usage will be slightly reduced. What Other Tunable Values Should Be Changed at the Same Time? and should be considered. should be changed in the same manner as since lowering the total number of segments but raising the number available per process only makes sense if you want a few processes taking all the segments. is more complex and any changes to it really depend on the effect desired. Refer to the shmmax(5) manpage for more information before changing this tunable. 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
shmem(5), shmmax(5), shmseg(5). Tunable Kernel Parameters shmmni(5)
All times are GMT -4. The time now is 10:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy