Unix Gurus,
I have been breaking my head to get this done..seems simple..
I need to read a flat file and based on a key word in a line, i need to skip the previous 3 lines.
eg :
Line1
Line2
Line3
Line4
Line5
Line6
Error
Line7
Line8
Line9
Error
Line10 (4 Replies)
Hello,
With next simple command line I get all allocated semaphore numbers:
ipcs -s | awk 'NR > 3 {print $2}'
Now I want to add ipcrm -s before each semaphore id and actually delete every last of them.
The question is: Can I do the operation in a command itself, without redirecting awk... (2 Replies)
Hi,
I'm not sure, there is solution exist for this problem. I'm facing problem in calling a unix script from awk code. Here is code
nawk -F'=' '
BEGIN { }
function runtest(string)
{
LINE
}
/^/ { # getting module name
t=$1
module=substr(t,2,(length(t)-2))
runtest(module)
}... (1 Reply)
hi there
I have a view which is working fine, but i have been told that i need to make sure the resulting output excludes all rows with nic_status equal to the string "removed".
Does anybody know in which part of the code below i would place the conditional ...
WHERE nic_status !=... (4 Replies)
Hi All,
How do we call a method existing in another file inside awk.
After matching a pattern i want to call a method secureCopy that exists in another file, but method not getting called:
ls -l |
awk -v var2=$servername -v var1=$srcserverpath -v var3=$tgtpath '... (1 Reply)
Database
rina lives:fatin:20:20:20
rina:fatin:20:20:20
i am having a small problem in extracting out the information from the database. For example, if i were to input a book titled rina into my search , i would only want it to display the row which has the title rina, like this
... (4 Replies)
I am trying to call awk from a csh script using
awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv
and getting awk: Command not found.
Running
awk '{print $1, -$2, $3}' $fvmod.vel > $fvmod.xzv
on the command line with the actual filenames works (2 Replies)
I have to call two awk scripts where the second one used the output from the first one. Am wondering if it may happen that the second awk might start before the first awk finished creating the file...
if ($nAnomaly == 1) then
awk -v anomaly=$Anom -v zloc="$zmin/$zmax" -v dz=$dz \
... (1 Reply)
I want to run awk from php to do some text processing. I am giving an extremely simple example below:
onecol.awk file
-------------------
{
print "Hello!";
}
f1.txt
---------
aaa
ccc
eee
f2.txt
--------- (6 Replies)
Hello I have the file df.tmp
FS is actually the / FS but escape character\ and end of line $ is used in order to fetch exctly / and not other filesystems.
awk '/\/$/ {print $(NF-1)+0}' df.tmp will work properly and return a value eg. 60
but when I am trying to issue the command with the array... (3 Replies)