I want to redirect the output of a bash script to a file.
The script is:
#!/bin/bash
echo "recursive c"
for ((i=0;i<=20;i+=1)); do
time ./recursive
done
But if I run it like this:
script.sh >> temp.txt
only the output of ./recursive will be captured in the file.
I want to capture the output of time command in the file.