Origin of <file.tmp to pass input parameters

AI Thread Summary
The discussion centers on the use of input redirection in command-line interfaces, specifically how to automate the input of file names for a program that prompts for them. The method described involves using the command "test.exe <files.tmp," where "files.tmp" contains the necessary file names on separate lines. This technique successfully bypasses the need for manual input, allowing the program to run seamlessly. The concept of input redirection, indicated by the "<" symbol, is applicable in both Unix/Linux and Windows environments, enabling users to streamline their workflow by directing input from a file instead of the keyboard. Additionally, the ">" symbol is mentioned as a means to redirect output to a file.
jelanier
Messages
67
Reaction score
1
I was just curious. I have a program that asks for input file name and output name when the console is executed. I needed to run it and automatically pass these file names. I found a way..

test.exe <files.tmp

where files.tmp has 2 lines. First line is name of input file, second is output file.

It works, and the exe runs without asking for file names. I tried it on several of my FORTRAN console exes and it works! It will pass whatever the exe asks for input.

Where does this come from? I was thinking unix, but it works in windows.
Any ideas?

Jim
 
Technology news on Phys.org
jelanier said:
I was just curious. I have a program that asks for input file name and output name when the console is executed. I needed to run it and automatically pass these file names. I found a way..

test.exe <files.tmp

where files.tmp has 2 lines. First line is name of input file, second is output file.

It works, and the exe runs without asking for file names. I tried it on several of my FORTRAN console exes and it works! It will pass whatever the exe asks for input.

Where does this come from? I was thinking unix, but it works in windows.
Any ideas?

Jim

It works because the concept of input redirection works in both Unix (or Linux) and Windows. The < character on the command line means "take input from this file instead of the console (keyboard)."

Similarly, the > character redirects output from the usual output device (the monitor) to whatever file appears following this character.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Back
Top