@Vijin Palazhi @Tej_Singh_Rana @Mohamed Ayman How do we print the following usin . . .

kartik_kube:
@Vijin Palazhi @Tej_Singh_Rana @Mohamed Ayman How do we print the following using command? and then copy to /opt/test.text?

date
echo hey "Jason!" welcome to water world
date

kartik_kube:
Hi @Tej_Singh_Rana can you please help to answer this question?

Vijin Palazhi:
Hi @kartik_kube do you mean just to print these on the screen and add them to a file?

If so you can do this:

echo `date` | tee -a /opt/test.text
echo 'hey "Jason!" welcome to water world' | tee -a /opt/test.text
echo `date` | tee -a /opt/test.text

Vijin Palazhi:
you can also possibly look to club all the echo statements together and use tee -a to print them on the screen and append to the file

kartik_kube:
@Vijin Palazhi
I mean to enter the output of all these to the file “/opt/test.text”
How do I do this using the “command” in a container?