Sponsored Content
Top Forums UNIX for Advanced & Expert Users awk and fuction (recursion) !! Urgent !! Post 302178493 by era on Tuesday 25th of March 2008 04:07:56 PM
Old 03-25-2008
Quote:
Originally Posted by varungupta
Code:
                                echo "***inside while loop 2. ***"
                                        `awk 'function fun( n, pattern )
                                               {
                                                `awk '{ if($2~n && $1~pattern){

You can't nest backticks like that. However, there's an alternate syntax which works.

Code:
var=$(echo outer and $(echo inner) backticks, oh my)

You would be more likely to get useful replies if you pared down the question to just the specific problem you have, rather than post an enormous script.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Get Oracle fuction return value in a variable

Hi All, :confused: I have the following code. var=' ' sqlplus user/pass@DB <<EOF whenever sqlerror exit 1 select package.func() into $var from dual; EOF echo $var But, this code does not work to display the value returned by the oracle function. Do we have to bind variables before... (3 Replies)
Discussion started by: rahulrathod
3 Replies

2. Programming

about memset fuction

Dear all, In my code,i am planning to use memset function to re-initialise an array before populating it everytime. Will using memset function be an overload to the program? (3 Replies)
Discussion started by: ranj@chn
3 Replies

3. Shell Programming and Scripting

Help me for AWK URGENT

i have a record like 1,23423,4545,6767,89898,3434,121212,123123,322 2,23233,3434,4545,56566,rxrx,e344343,343434,3434 1,23223,336,78787,78787,654,6767677,6877989,7878 i want to check the $6 field if its start with any letters, i want to move this record to some other file and keep rest of... (2 Replies)
Discussion started by: readycpbala
2 Replies

4. Shell Programming and Scripting

Urgent!!!!! AWK

Thank everyone advanced. Would you please tell me how to use the shell variable in the awk body? I try follows but they all do not work, pls kindly help me: 1. str=`cat file2` awk 'BEGIN{print("'"$str"'"}' file1 > file3 2. str=`cat file2` awk 'BEGIN{print(ENVIRON}' file1 > file3 3.... (3 Replies)
Discussion started by: summer_cherry
3 Replies

5. UNIX for Dummies Questions & Answers

awk help urgent

Hi i am trying to read a line from a file and add the values in a new file eg Input file a1|a2|a3|a4|a5|a6 b1|b2|b3|b4|b5|b6 c1|c2|c3|c4|c5|c6 expected output File one a1|a2|a3 b1|b2|b3 c1|c2|c3 (3 Replies)
Discussion started by: rysh
3 Replies

6. Shell Programming and Scripting

fuction return in perl

Hi All, I have a perl script(1.pl) that calls a c function defined in another file sample.c #!/usr/bin/perl my $re = 1; my @s = `/home/PERL_SCRIPTING/Rough/sample pline $re 10`; print "$_" foreach(@s); The sample.c is as bwlow: # include <stdio.h> int pline(int, int);... (4 Replies)
Discussion started by: jisha
4 Replies

7. Shell Programming and Scripting

urgent help awk script

Hi I have a scenario where i have a file name as abcd_To_hfgh.20090456778_1.dat I will get the filename as parameter and i need a string in between second _ and first . i.e i need hfgh in this case. Please help me with the script. This may not be awk script even if it can be... (2 Replies)
Discussion started by: dsdev_123
2 Replies

8. Shell Programming and Scripting

Urgent awk help !!

Hi All,I need to convert following field from a file L2578978CLC/576/116804 => L2578978CLC/00000576/00168304 i have to append Zeros in the third and fourth number after slash / in the above string (total length of number should be 8). means L2578978CLC/576/116804 should be converted to... (3 Replies)
Discussion started by: unknown123
3 Replies

9. Shell Programming and Scripting

Perl system fuction with

Hi, I've written a perl script with a nested foreach statement in it. I have the line code: foreach $argn(@arguments) { foreach $location (@path) { system("find $location -name \"$argn\" -print >> results.txt"); ... (2 Replies)
Discussion started by: tchoruma
2 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWgawk | +--------------------+-----------------+ |Interface Stability | Volatile | +--------------------+-----------------+ NOTES
Source for gawk is available on http://opensolaris.org. Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 09:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy