getting input, then outputting it


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers getting input, then outputting it
# 1  
Old 06-26-2008
Question getting input, then outputting it

Hi!

I am a newbie to Unix. I was writing a little game program for fun when thought of an idea to allow data to be saved. I knew to take all of the Predefined variables and put them into a separate file, then including the file in the program. But I am having trouble making it so that the user can tell it to save the data and it would write the data to the page holding the Predefined variables. I am using PHP in my program.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Outputting colours in HP-UX scripts

Hi all, This is my first ever posting, so please be gentle with me :) I'm trying to write a script in HP-UX which outputs text in different colours, but although I can get the script to output different colours to the screen, I can't get it to write different colours to a file. Take the... (4 Replies)
Discussion started by: neilharvey
4 Replies

2. Shell Programming and Scripting

awk not outputting properly

Hi Everyone, Long time lurker here. I have a project of bringing every one of our data centers to a newly enforced company standard. Standard naming conventions, domain migrations, etc. So, the people who are setting the standards are providing me with a CSV file. Column 1 has the old... (23 Replies)
Discussion started by: Zaphod_B
23 Replies

3. UNIX for Dummies Questions & Answers

outputting set -x to file

I need to enable set -x in my croned script as at times the script is not returning all data that it should be. This only happens intermittently and as such I would like a means of being able to check what goes wrong. My question is how to output the debug of set -x to file? (1 Reply)
Discussion started by: rob171171
1 Replies

4. Shell Programming and Scripting

Problem outputting increment

With this script the output to the terminal does not increment. Can anyone tell me what I need to do to get this to increment output to the terminal? Here is the output mpath major,minor number ls: /dev/mapper/mpathp1: No such file or directory raw device output 253,44 echo raw device... (5 Replies)
Discussion started by: bash_in_my_head
5 Replies

5. Homework & Coursework Questions

Outputting variables on a line

Stuck on formatting an output. I want to list 6-99 on the screen, looking something like this: 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 and so on down to 6. So far I am only able to print one value per line. This is what I have I have defined x as integer x=99... (2 Replies)
Discussion started by: huckknows
2 Replies

6. Shell Programming and Scripting

Outputting to table

I have information in a file called HITS. This file has been populated by the user entering search criteria. the HITS file contains information: filname.hits: 123.33.345.66 Fri Nov 26 11.45.56.43 GMT 2006 at the moment i am just displayin the information using cat HITS. ... (3 Replies)
Discussion started by: amatuer_lee_3
3 Replies

7. Shell Programming and Scripting

grep: outputting search strings

Newbie question -- any help very much appreciated: I want to be able to get grep (or whatever else would work) to return not only matching lines, but also the original input string: An example may help: Suppose I have two files data1.txt and data2.txt: data1.txt Hello my name is foo. What... (3 Replies)
Discussion started by: tapmas
3 Replies

8. Shell Programming and Scripting

Help in outputting the result in log files

This is the file am having: "40","1G1AL55 ",30482,9000 "40","1G1ZT58 ",29098,10600 "40","1G1AL15 ",29222,9400 "46","1G6KD57 ",3083,28400 "46","1G6KD57 ",27909,25200 "49","1G1ZU57 ",16391,13900 "49","1G2ZG58 ",28856,12400 I want to display the output in three files... (23 Replies)
Discussion started by: dave_nithis
23 Replies

9. Shell Programming and Scripting

Outputting from two input files.

Ok, lets suppose I have two files like so: file1 John 5441223 Sandy 113446 Jill 489799 file2 Sandy Tuesday Jill Friday John Monday Is it possible to match records from these two files and output them into one output file? For example, lets suppose I want to output like this: ... (5 Replies)
Discussion started by: Liguidsoul
5 Replies

10. Shell Programming and Scripting

sed not outputting last line of input file

I am using sed for a simple substitution (see command syntax below). Everything works fine except that the last line of the input file does not get written to the output file. Has anyone ever seen this and know of way to force the last line to be written? I don't know if it's playing a part in... (3 Replies)
Discussion started by: 2reperry
3 Replies
Login or Register to Ask a Question
funref(3)							SAORD Documentation							 funref(3)

NAME
FunRef - the Funtools Reference Handle SYNOPSIS
A description of how to use a Funtools reference handle to connect a Funtools input file to an output file. DESCRIPTION
The Funtools reference handle connects a Funtools input file to a Funtools output file so that parameters (or even whole extensions) can be copied from the one to the other. To make the connection, the Funtools handle of the input file is passed to the final argument of the FunOpen() call for the output file: if( !(ifun = FunOpen(argv[1], "r", NULL)) ) gerror(stderr, "could not FunOpen input file: %s ", argv[1]); if( !(ofun = FunOpen(argv[2], "w", ifun)) ) gerror(stderr, "could not FunOpen output file: %s ", argv[2]); It does not matter what type of input or output file (or extension) is opened, or whether they are the same type. When the output image or binary table is written using FunImagePut() or FunTableRowPut() an appropriate header will be written first, with parameters copied from the input extension. Of course, invalid parameters will be removed first, e.g., if the input is a binary table and the output is an image, then binary table parameters such as TFORM, TUNIT, etc. parameters will not be copied to the output. Use of a reference handle also allows default values to be passed to FunImagePut() in order to write out an output image with the same dimensions and data type as the input image. To use the defaults from the input, a value of 0 is entered for dim1, dim2, and bitpix. For example: fun = FunOpen(argv[1], "r", NULL); fun2 = FunOpen(argv[2], "w", fun); buf = FunImageGet(fun, NULL, NULL); ... process image data ... FunImagePut(fun2, buf, 0, 0, 0, NULL); Of course, you often want to get information about the data type and dimensions of the image for processing. The above code is equivalent to the following: fun = FunOpen(argv[1], "r", NULL); fun2 = FunOpen(argv[2], "w", fun); buf = FunImageGet(fun, NULL, NULL); FunInfoGet(fun, FUN_SECT_DIM1, &dim1, FUN_SECT_DIM2, &dim2, FUN_SECT_BITPIX, &bitpix, 0); ... process image data ... FunImagePut(fun2, buf, dim1, dim2, bitpix, NULL); It is possible to change the reference handle for a given output Funtools handle using the FunInfoPut() routine: /* make the new extension the reference handle for the output file */ FunInfoPut(fun2, FUN_IFUN, &fun, 0); When this is done, Funtools specially resets the output file to start a new output extension, which is connected to the new input reference handle. You can use this mechanism to process multiple input extensions into a single output file, by successively opening the former and setting the reference handle for the latter. For example: /* open a new output FITS file */ if( !(fun2 = FunOpen(argv[2], "w", NULL)) ) gerror(stderr, "could not FunOpen output file: %s ", argv[2]); /* process each input extension in turn */ for(ext=0; ;ext++){ /* get new extension name */ sprintf(tbuf, "%s[%d]", argv[1], ext); /* open it -- if we cannot open it, we are done */ if( !(fun=FunOpen(tbuf, "r", NULL)) ) break; /* make the new extension the reference handle for the output file */ FunInfoPut(fun2, FUN_IFUN, &fun, 0); ... process ... /* flush output extension (write padding, etc.) */ FunFlush(fun2, NULL); /* close the input extension */ FunClose(fun); } In this example, the output file is opened first. Then each successive input extension is opened, and the output reference handle is set to the newly opened input handle. After data processing is performed, the output extension is flushed and the input extension is closed, in preparation for the next input extension. Finally, a reference handle can be used to copy other extensions from the input file to the output file. Copy of other extensions is con- trolled by adding a "C" or "c" to the mode string of the FunOpen() call of the input reference file. If "C" is specified, then other extensions are always copied (i.e., copy is forced by the application). If "c" is used, then other extensions are copied if the user requests copying by adding a plus sign "+" to the extension name in the bracket specification. For example, the funtable program utilizes user-specified "c" mode so that the second example below will copy all extensions: # copy only the EVENTS extension csh> funtable "test.ev[EVENTS,circle(512,512,10)]" foo.ev # copy ALL extensions csh> funtable "test.ev[EVENTS+,circle(512,512,10)]" foo.ev When extension copy is specified in the input file, the call to FunOpen() on the input file delays the actual file open until the output file also is opened (or until I/O is performed on the input file, which ever happens first). Then, when the output file is opened, the input file is also opened and input extensions are copied to the output file, up to the specific extension being opened. Processing of input and output extensions then proceed. When extension processing is complete, the remaining extensions need to be copied from input to output. This can be done explicitly, using the FunFlush() call with the "copy=remaining" plist: FunFlush(fun, "copy=remaining"); Alternatively, this will happen automatically, if the output file is closed before the input file: /* we could explicitly flush remaining extensions that need copying */ /* FunFlush(fun2, "copy=remaining"); */ /* but if we close output before input, end flush is done automatically */ FunClose(fun2); FunClose(fun); SEE ALSO
See funtools(7) for a list of Funtools help pages version 1.4.2 January 2, 2008 funref(3)