![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| c function calling from a pearl script | jisha | Shell Programming and Scripting | 2 | 04-02-2008 02:50 AM |
| Help needed to Keep calling a function after every 5 seconds. | nua7 | Shell Programming and Scripting | 11 | 03-25-2008 05:08 AM |
| calling one function from another shell script | trichyselva | UNIX for Dummies Questions & Answers | 1 | 01-16-2008 09:28 PM |
| urgent calling function from a script | jisha | Shell Programming and Scripting | 2 | 01-09-2008 11:40 AM |
| calling c++ function from script | Lebamb | High Level Programming | 3 | 06-24-2003 06:53 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help needed in function calling in a script
I have a script as shown below: rpttxt() { name="$*" awk '/'"${name}"'/ {print $2 $3"=" $4}' file.txt } xx = rpttxt "COL_HEAD_1" awk 'BEGIN {printf("%36s \n ","'"$xx"'")}' rpttxt() is a function..I want to store the final result of this function in the variable "xx" and print this in a specific format.. When i run this script i get an error : line 8: xx: command not found Is their any error in calling the function ..? Thanks in advance JS |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
I have solved it
Condiser the thread closed.. Thanks JS |
|
#3
|
|||
|
|||
|
Good that you solved it but, it is better to post that how did you solve it...! Atleast the next one like me (dumb) will get to know the solution :-)
Thanks in advance. -ilan |
|
#4
|
|||
|
|||
|
The script is :
rpttxt() { name="$*" awk '/'"${name}"'/ {print $2 $3"=" $4}' file.txt } xx = rpttxt "COL_HEAD_1" awk 'BEGIN {printf("%36s \n ","'"${xx}"'")}' Actually the problem was with my file.txt It had got some quotes in it due to which the script didnt run properly. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|