How do I print only to a file instead of displaying the results in the terminal in the bash script?

Asked 2 years ago, Updated 2 years ago, 95 views

How do I print only the json file?

 echo-e "$STR" | tee$date.json

I think I can do something about the echo here.
But I'm still a beginner, so I don't know exactly what commands to use, so please let me know.

bash

2022-09-29 21:55

1 Answers

Since the tee command outputs both standard output and files, you should simply redirect using >.

 echo-e "$STR" > $date.json


2022-09-29 21:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.