When I run the following script, output of ls -la
is stored to variable $output
.
#! /bin/sh
output=$(ls -la)
How can I pipe output of ls -la
to stdout
and $output
?
I am asking in the context of running borgbackup which can output for a long time during backups.
I would like to be able to track progress when I manually run script while storing output in $output
to send it to sysadmin via email.