Origin of <file.tmp to pass input parameters

Click For Summary
SUMMARY

The discussion centers on the use of input redirection in command-line interfaces, specifically how the command test.exe < files.tmp allows users to automatically pass input parameters to executable programs without manual entry. This method works in both Unix-like systems and Windows, utilizing the < code> < symbol to redirect input from a specified file. The file files.tmp contains two lines, where the first line specifies the input file name and the second line specifies the output file name. This technique has been successfully applied to FORTRAN console executables.

PREREQUISITES
  • Understanding of command-line interfaces
  • Familiarity with input/output redirection concepts
  • Basic knowledge of executable file operations
  • Experience with FORTRAN programming
NEXT STEPS
  • Research input redirection in Unix/Linux systems
  • Explore command-line arguments in Windows executables
  • Learn about batch scripting for automated execution
  • Investigate advanced FORTRAN I/O operations
USEFUL FOR

This discussion is beneficial for software developers, particularly those working with command-line applications, system administrators automating tasks, and programmers using FORTRAN who need to streamline input processes.

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.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
9K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
3
Views
2K
  • · Replies 89 ·
3
Replies
89
Views
6K
  • · Replies 3 ·
Replies
3
Views
4K