Hi I'm a newbie to Unix scripting and was having some problems with AWK. I have written this little script that should read a process list and then print out the PID's of the offending processes. Unfortunately it doesn't seem to work! The script is as follows:
ps -ef | awk '{if... (10 Replies)
If i try the -f option for awk, i get the "awk: can't open " error message
The following awk statement works fine without the -f option
`awk <$RULES '/^IGNORE_POLICY / { print $2 }'`
Below how i turned on debugging to show what is happening, can someone provide me with some advice!!!!
... (1 Reply)
Using Linux, I am trying to create a list of all the lines that have "Non-white" or "No" in column 3 of a file: ethnicity.txt.
I have used the following command :
awk '$3 == "No" || $3 == "Non-white" {print $1, $2, $3}' ethnicity.txt
This only returns the lines with "No" and none of... (3 Replies)
Hi All,
I have the following requirement. In a directory i get files from external source. I at regular intervals check that directory for any incoming files.
The file name is underscore delimited.
Such as:
aaa_bbb_ccc_ddd_eee_fff.dat
I am using awk and and splitting the file name. ... (4 Replies)
Hi I am writing a shell script for a number of things and aone problem that keeps comming up is AWK formatting.
When commands are typed into the command line they are fine, but when executed in the script the results are pilled up and not in a list/table format.
I have tried using ... (2 Replies)
Dear All,
I have the following awk script.
#!/bin/bash
sh stdev.cmd data.file | awk '{print $2}' > out.data
read d < out.data
echo $d
awk '{print $1,$2- $f}' new > newz
The script runs "stdev.cmd" and output a file "out.data" and the value of the... (2 Replies)
So, I'm having a lot of crazy problems with Awk that I cannot understand. This one in particular is driving me nuts. Here is one section of my Awk script:
print $0
sub(/Jan/,"",$2)
sub(/Feb/,"",$2)
sub(/Mar/,"",$2)
sub(/Apr/,"",$2)
sub("May","",$2)
... (5 Replies)
Ubuntu, Bash 4.3.48
Hi,
I have this input file:
a1:b2:c30:g4:h12:j7
and I want this output file:
a1=g4:b2=h12:c30=j7
I can do it this with this code:
awk -F':' '{print $1"="$4":"$2"="$5":"$3"="$6"}' INPUT > OUTPUTIn this case I have 6 columns, I calculate manually the half number of... (6 Replies)
Discussion started by: echo manolis
6 Replies
LEARN ABOUT DEBIAN
tau_profile_set_context
TAU_PROFILE_SET_CONT(3) TAU Instrumentation API TAU_PROFILE_SET_CONT(3)NAME
TAU_PROFILE_SET_CONTEXT - Informs the measurement system of the context id
SYNOPSIS
C/C++:
TAU_PROFILE_SET_CONTEXT(int context);
Fortran:
TAU_PROFILE_SET_CONTEXT(integer context);
DESCRIPTION
The TAU_PROFILE_SET_CONTEXT macro sets the context identifier of the executing task for profiling and tracing. Tasks are identified using
context, context and thread ids. The profile data files generated will accordingly be named profile.<context>.<context>.<thread>. Note that
it is not necessary to call TAU_PROFILE_SET_CONTEXT when using the TAU MPI wrapper library.
EXAMPLE
C/C++ :
int main (int argc, char **argv) {
int ret, i;
pthread_attr_t attr;
pthread_t tid;
TAU_PROFILE_TIMER(tautimer,"main()", "int (int, char **)",
TAU_DEFAULT);
TAU_PROFILE_START(tautimer);
TAU_PROFILE_INIT(argc, argv);
TAU_PROFILE_SET_NODE(0);
TAU_PROFILE_SET_CONTEXT(1);
/* ... */
TAU_PROFILE_STOP(tautimer);
return 0;
}
Fortran :
PROGRAM SUM_OF_CUBES
integer profiler(2) / 0, 0 /
save profiler
INTEGER :: H, T, U
call TAU_PROFILE_INIT()
call TAU_PROFILE_TIMER(profiler, 'PROGRAM SUM_OF_CUBES')
call TAU_PROFILE_START(profiler)
call TAU_PROFILE_SET_NODE(0)
call TAU_PROFILE_SET_CONTEXT(1)
! This program prints all 3-digit numbers that
! equal the sum of the cubes of their digits.
DO H = 1, 9
DO T = 0, 9
DO U = 0, 9
IF (100*H + 10*T + U == H**3 + T**3 + U**3) THEN
PRINT "(3I1)", H, T, U
ENDIF
END DO
END DO
END DO
call TAU_PROFILE_STOP(profiler)
END PROGRAM SUM_OF_CUBES
SEE ALSO TAU_PROFILE_SET_NODE(3)
08/31/2005 TAU_PROFILE_SET_CONT(3)