To be more preciser, the above statements echo the return code on the screen. The way to get the return code with the above statements in your script is:
To return an exit code you can use the exit statement of awk:
hello all
I have long awk function that doing manipulations on text file but when I write the out put to new text file I have carriage return between 2 print commands
How can I avoid this ?
Here is my awk :
echo $f | awk... (1 Reply)
I have a file with the record of person:
cat > $TMP/record.txt
John Torres M Single 102353 Address
Mark Santos M Maried 103001 Address
Carla Maria F Maried 125653 Address
#!/bin/ksh
ManipulateID(){
...
return 0;
... #or
return 1;
}
cat $TMP/record.txt | awk 'BEGIN {printf... (4 Replies)
I'm a bit stuck in getting variable from awk to shell. I tried searching but most of them showing to assign to shell variable via..
VAR=`echo $line | awk -F: '{print $1}'`
which is correct ofcourse
My problem is multiple assignments of variable like this one. The above solution will give... (10 Replies)
Hi
I have 2 working script, now i'd like to get the return value from the first and give it to the 2 script (both script work correctly if I run it separately). so i think the problem is only the first line in the way i pass the variable.
in the final the "print lst", is just to check the... (2 Replies)
Hello, I am using awk to process a file, and need to return a row that meets specific criteria.
awk 'BEGIN{sets variables}
{processes file, updates variables}
END{need to print a row that meets the criteria in one of the variables}
I have tried code in the END block like {print NR==var}... (1 Reply)
I have a string with the following information and want to return the number of entries enclosed by <> in awk
<stdin>: N = 441 <0.369000018/0.569000006> <0.369000018/0.569000006> <0/1> (7 Replies)
I have the following awk script that I am using to find the max value in the file and print results.
awk 'BEGIN {MAX=-1E100} {for (x=2; x<=NF; x++) if ($x>MAX) {MAX = $x; C1 = $1}} END {print substr(C1,1,11), substr(C1,13,4), substr(C1,18,2), MAX}' ABC*
Input (ABC*)
... (6 Replies)
What is an awk command to print only fields with a number in it??
Input file.......
S,S,S,S,S,S,S,S,S
001S,S,S,S,S,S,S,S,S
00219S,23S,24S,43S,47S,S,S,S,S
00319S,10S,23S,41S,43S,47S,S,S,S
00423S,41S,43S,46S,47S,S,S,S,S
00510S,23S,24S,43S,46S,S,S,S,S
00610S,23S,43S,46S,47S,S,S,S,S... (2 Replies)
The below awk is used with the attached index.html and matches the specific user id in the sub portion with path of /rundb/api/v1/plugin/49/. The command does run but the output is blank. Something changed in the file structure as it used to work.
So using the first line in the output:
... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT V7
struct
STRUCT(1) General Commands Manual STRUCT(1)NAME
struct - structure Fortran programs
SYNOPSIS
struct [ option ] ... file
DESCRIPTION
Struct translates the Fortran program specified by file (standard input default) into a Ratfor program. Wherever possible, Ratfor control
constructs replace the original Fortran. Statement numbers appear only where still necessary. Cosmetic changes are made, including chang-
ing Hollerith strings into quoted strings and relational operators into symbols (.e.g. `.GT.' into `>'). The output is appropriately
indented.
The following options may occur in any order.
-s Input is accepted in standard format, i.e. comments are specified by a c, C, or * in column 1, and continuation lines are specified
by a nonzero, nonblank character in column 6. Normally, a statement whose first nonblank character is not alphanumeric is treated
as a continuation.
-i Do not turn computed goto statements into switches. (Ratfor does not turn switches back into computed goto statements.)
-a Turn sequences of else ifs into a non-Ratfor switch of the form
switch {
case pred1: code
case pred2: code
case pred3: code
default: code
}
The case predicates are tested in order; the code appropriate to only one case is executed. This generalized form of switch state-
ment does not occur in Ratfor.
-b Generate goto's instead of multilevel break statements.
-n Generate goto's instead of multilevel next statements.
-en If n is 0 (default), place code within a loop only if it can lead to an iteration of the loop. If n is nonzero, admit code segments
with fewer than n statements to a loop if otherwise the loop would have exits to several places including the segment, and the seg-
ment can be reached only from the loop.
FILES
/tmp/struct*
/usr/lib/struct/*
SEE ALSO f77(1)BUGS
Struct knows Fortran 66 syntax, but not full Fortran 77 (alternate returns, IF...THEN...ELSE, etc.)
If an input Fortran program contains identifiers which are reserved words in Ratfor, the structured version of the program will not be a
valid Ratfor program.
Extended range DO's generate cryptic errors.
Columns 73-80 are not special even when -s is in effect.
Will not generate Ratfor FOR statements.
STRUCT(1)