I am trying to use the tee command to redirect output to a file, and I want the file to be created in a dir which is yet to be created.
date | tee new_dir/new_fi
mkdir ./new_dir && date | tee ./new_dir/new_file
Since it is tee command, it simultaneously writes both to the new_file and to stdout
tee
new_file
stdout