10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all, I just signed up to the forums, although, I have lurked on here for awhile. Anyways, my issue is I am trying to get awk to spit out something I can use without having to spend hours in excel hell haha. So, I used sed to replace the spaces with semicolons and redirected that to a file. ... (6 Replies)
Discussion started by: savigabi
6 Replies
2. Shell Programming and Scripting
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)
Discussion started by: drbiloukos
3 Replies
3. Shell Programming and Scripting
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)
Discussion started by: mary271
6 Replies
4. Shell Programming and Scripting
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)
Discussion started by: kristinu
1 Replies
5. Shell Programming and Scripting
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)
Discussion started by: kristinu
2 Replies
6. Shell Programming and Scripting
Hi All,
I have an awk statement and a function defined in a script.
I am trying to call the function from inside awk statement, i.e.
awk ' myFunk () ;' filename
But when I define myFunk() before awk, then I receive this error:
s2.sh: line 48: syntax error: unexpected end of file
and... (5 Replies)
Discussion started by: morningSunshine
5 Replies
7. Shell Programming and Scripting
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)
Discussion started by: abhinav192
1 Replies
8. Solaris
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)
Discussion started by: luckybalaji
1 Replies
9. Shell Programming and Scripting
Hi All,
My 1.txt contains some functions
fun1()
....
....
fun2()
....
....
I can call these fun from 2.txt inside awk as below
value="`fun1 "argument1"`"
awk 'BEGIN {printf ("%s", "'"$value"'")}'
I need to modify the above code so that without using the variable to store... (2 Replies)
Discussion started by: jisha
2 Replies
10. Shell Programming and Scripting
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)
Discussion started by: BaruchLi
2 Replies