print a function result in new file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting print a function result in new file
# 1  
Old 12-31-2007
print a function result in new file

Hi,

i have a function which return a variable .

serach ( paramatere) when i excute this function i get the result in the shell,

i want to print this result in a file by calling just the function.

how can i do it..

the code example is like that:

search ( )
{
..
}

the call must be done in the new file :

awk -F "," '{ {first=$1; sec=$2; tro=$3;quat=$4 }
if (tro == "")
{

$3 = search ( )

{print $1","$2","","$4} }
else
{print $1","$2","$3 $4}}' $file1 > $file2


i print the four variable in file1 delimitated by comma and i want to affect the result of function search to the variable $3?


when i write like that i don't have a result.
how can i do
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To get or print specific value in result

i am executing below code to achive my result, but for second row the value is not coming it should come URL like other two . url start with http:// and end with .xhtml cat FILE | grep 'Test failed' | awk -F',' '{print $3,$8,$12}' INPUT 1517679173303,84,SKILLED LANGUAGE - ENTER... (11 Replies)
Discussion started by: mirwasim
11 Replies

2. Shell Programming and Scripting

Compare 2 columns from the same file and print a value depending on the result

Hello Unix gurus, I have a file with this format (example values): label1 1 0 label2 1 0 label3 0.4 0.6 label4 0.5 0.5 label5 0.1 0.9 label6 0.9 0.1 in which: column 1 is a row label column 2 and 3 are values I would like to do a simple operation on this table and get the... (8 Replies)
Discussion started by: ksennin
8 Replies

3. Shell Programming and Scripting

Print smallest integer from file using awk custom function?

`awk` function looks like this in a file name `fun.awk`: { print small() } function small() { a=$0 smal=0 for(i=1;i<=3;i++) { if( a<a) smal=a else (4 Replies)
Discussion started by: lazerz
4 Replies

4. UNIX for Dummies Questions & Answers

Print result of mv -n

I am trying to move files which donot have same filename using find /Users/ParijatMac/desktop/unix/new_dir -type f -mmin +"$HRS" -exec mv -n "{}" /Users/ParijatMac/desktop/unix/old_dir \; -print but i am getting all filenames including the ones with duplicate names.Please help me to sort... (5 Replies)
Discussion started by: parijat guh
5 Replies

5. Shell Programming and Scripting

Print if found non-desired result

I have a result like this root@server # grep -rl maldet /etc/cron* /etc/cron.d/maldet_daily /etc/cron.d/malcron /etc/cron.d/malcrondaily /etc/cron.d/malcronweekly What I need is, I need an if/else condition such that, if there is any output other than /etc/cron.d/maldet_daily in the... (8 Replies)
Discussion started by: anil510
8 Replies

6. Shell Programming and Scripting

Use the print result of a script as an argument

Hi all, Say I have a script named script.sh. What it does is to print a line like "abc" #! /usr/bin/ksh print "abc" I would like to pass this value to an external variable, var1="script.sh" However when I echo $var1 I got "script.sh" itself instead of the result? Thanks (3 Replies)
Discussion started by: isaacniu
3 Replies

7. Shell Programming and Scripting

A function in shell script,how can i get the right result

there is a directory /data/users/osa/psidp/dmp/files/cimdir ,it have some subdirectories ,and also the subdirectoriy have it's subdirectoriis. I want to get all the leaf nodes of the directory path . but the result of the script is wrong ,how can i get the right result somebody who can help me... (3 Replies)
Discussion started by: fw0037
3 Replies

8. Shell Programming and Scripting

a function in shell script,how can i get the right result

there is a directory /data/users/osa/psidp/dmp/files/cimdir ,it have some subdirectories ,and also the subdirectoriy have it's subdirectoriis. I want to get all the leaf nodes of the directory path . but the result of the script is wrong ,how can i get the right result somebody who can... (1 Reply)
Discussion started by: fw0037
1 Replies

9. Homework & Coursework Questions

A function in shell script,how can i get the right result

there is a directory /data/users/osa/psidp/dmp/files/cimdir ,it have some subdirectories ,and also the subdirectoriy have it's subdirectoriis. I want to get all the leaf nodes of the directory path . but the result of the script is wrong ,how can i get the right result somebody who can help... (1 Reply)
Discussion started by: fw0037
1 Replies

10. Shell Programming and Scripting

print out result from data file

i got a data file which contains all the pid,ppid,user,command,pcpu,start_time,status. I wanted to display out the pcpu which is greater than 0. i uses awk'{if($5 > 0){print}}' filename.txt but is printing out result which not i wanted. Is there any way which i can print out those pcpu which is... (8 Replies)
Discussion started by: thms_sum
8 Replies
Login or Register to Ask a Question
XmPrintSetup(library call)												XmPrintSetup(library call)

NAME
XmPrintSetup -- setup and create a Print Shell widget SYNOPSIS
#include <Xm/Print.h> Widget XmPrintSetup( Widget video_widget, Screen *print_screen, String print_shell_name, ArgList args, Cardinal num_args); DESCRIPTION
A function that does the appropriate setting and creates a realized XmPrintShell that it returns to the caller. This function hides the details of the Xt to set up a valid print shell heirarchy for the application. It is also meant to encourage consistency in the way appli- cations root their print widget hierarchy. print_screen must belong to a Display connection that has already been initialized with Xt. The video_widget is used to get at the application context, application name and class, and argc/argv stored on the applicationShell that roots this widget. If no applicationShell is found, NULL argv/argc are used. XmPrintSetup then creates an unrealized ApplicationShell with the same name and class as the one given by the video display, on the print display and on the print screen specified. An XmPrintShell is then created as a child of this toplevel shell, using XtCreatePopupShell, with the name print_shell_name, and using the args provided. It then realizes and maps the print shell, using XtPopup with XtGrabNone. This way, application resource files and users can specify print specific attributes using the following syntax (if print_shell_name is "Print"): Dtpad.Print*textFontList: somefont *Print*background:white *Print*highlightThickness:0 video_widget A video widget to fetch app video data from. print_screen A print screen on the print display - specifies the screen onto which the new shell is created. print_shell_name Specifies the name of the XmPrintShell created on the X Print server. args Specifies the argument list from which to get the resources for the XmPrintShell. num_args Specifies the number of arguments in the argument list. RETURN VALUE
The id the XmPrintShell widget created on the X Print Server connection, or NULL if an error has occured. ERRORS
/WARNINGS None. EXAMPLES
From the OK callback and the SetUp callback of the primary print dialog widget: static void printOKCB(Widget, XtPointer call_data, XtPointer client_data) { AppPrint *p = (AppPrint *) client_data; DtPrintSetupCallbackStruct *pbs = (XmPrintCallbackStruct *) call_data; /* connect if not already done. the print dialog callback always provides valid printer name, print display and screen already initialized: XpInitContext called */ */ p->print_shell = XmPrintSetup (widget, pbs->print_screen, "Print", NULL, 0); ... } SEE ALSO
XmPrintShell(3), XmRedisplayWidget(3), XmPrintToFile(3), XmPrintPopupPDM(3) XmPrintSetup(library call)