![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| manage function's output | rambler | Shell Programming and Scripting | 3 | 10-28-2008 01:02 AM |
| value inside a function | trichyselva | Shell Programming and Scripting | 2 | 08-04-2008 08:44 AM |
| to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's | manas6 | UNIX for Dummies Questions & Answers | 0 | 06-05-2008 07:44 AM |
| looping a array inside inside ssh is not working, pls help | reldb | Shell Programming and Scripting | 5 | 07-07-2006 11:32 AM |
| inside the JVM | rein | UNIX for Advanced & Expert Users | 1 | 08-05-2005 02:57 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Function's return value used inside awk
I have a file with the record of person:
Code:
cat > $TMP/record.txt John Torres M Single 102353 Address Mark Santos M Maried 103001 Address Carla Maria F Maried 125653 Address Code:
#!/bin/ksh
ManipulateID(){
...
return 0;
... #or
return 1;
}
cat $TMP/record.txt | awk 'BEGIN {printf ("%s", "'"`ManipulateID "$5"`"'")}'
function in my script, the function will do some manipulation and test. The function will return 0 if the test is good and 1 if not. The returning value of 0 and 1 will be return back to awk and awk will test it. If the returning value of my function is 0 awk will display the whole row ($0) and do nothing if returning value of function is 1. Anyone who can help me? |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix commands, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|