in an awkscript is an attempt to look at the contents of the field specified by dividing the value of the awk variable cat by the value of the awk variable proc ... divided by the value of the awk variable shmmax. And, since none of those awk variables are defined in your awk script, they all evaluate to 0 (i.e., $(0/0/0/0)) which dies on the attempt to divide by 0.
What you are trying to do is not clear. What output do you get from the command:
If you insist on using awk and for some reason you don't want to do it the same way you checked SEMMNS (using $1 instead of $2), you could also try something like:
In few servers" cat /proc/sys/kernel/shmma"x value would be already present in "/etc/sysctl.conf", in that case it should not add nedd to update the vlaue
Thank you 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:
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)
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)
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)
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)
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)
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)
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)
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)
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)