First, disclaimer: I am very new at this.
I am trying to write a simple bash script for an assignment. I need to print the output of date, finger, and uptime to stdout, and to a file. From what I'm reading, the failure to exit seems to be because the processes are running in a subshell, but from the reading, I don't really understand how to do it. I found that using a pipe and input redirection via tee gives me the result I want, but it will not exit. Besides a pipe, and especially typing: | tee Time_Script_Output.txt on each line seems very inefficient, and I'm looking for a cleaner way to write the script.
code:
#! /bin/bash
bash
/bin/date | tee Time_Script_Output.txt &
/usr/bin/finger | tee Time_Script_Output.txt &
/usr/bin/uptime | tee Time_Script_Output.txt
exit
Thanks!, Nick Kavanagh