I have a script getInfo.sh
I made in Linux that collects information about the user, date, number of users logged into current environment, and many other features.
I could easily outside of the file have something where it is ./getInfo.sh > results.txt
.
However I would like this to happen automatically within the script.
If I were to include the ./getInfo.sh > results.txt
within the script itself it would create an infinite loop as each time it hits the ./getInfo.sh
it will re-run the script and create an infinite loop.
Any alternatives here?