1

I was wondering how to redirect the output from my bash file (which is getting its input from another redirect) to a txt file.

This is how I run my program:

$ ./myFile.bash < input.txt

I would like to save my output to some txt file (something like this):

$  out.txt < ( myFile.bash < input.txt )

What would be the most correct/formal/generic ways to go about this? Are there multiple options if any?

1
  • You might want to look into the syntax of >, >> and |. Those should be explained in any basic tutorial such as learnxinyminutes.com/docs/bash But in short, > takes the output of a command and write it into a file. But be careful, that overrides the current of the file. >> appends the output to a file. Commented Nov 17, 2020 at 0:04

1 Answer 1

1
$ ./myFile.bash < input.txt > out.txt
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.