what u need to do with the vars
include all code in tee
or try

exec > >( tee -a log ) 2>&1
set -x
. my.bash
...

what i firstly meant :

#!/bin/bash
 tee -a log < <(
all code here
set -x ; . code ; other code that needs the vars set
maybe needs a 2> smth
 )

try

 (
set -x
. mybash
vars_code
 ) |& tee -a log


On Thu, Nov 14, 2024, 12:19 AM Yuri <y...@rawbw.com> wrote:

> On 11/13/24 14:48, #!microsuxx wrote:
> > 1st source cmd , no extra cmds 2. { . foo ; code ; code ; } | tee 3rd
> > tee < <( . foo ; cmds )
>
>
> I need to (1) source the user script, (2) save this script's output to a
> dedicated file, (3) keep the same output in stdout, and (4) keep
> environment variables that the user script sets for later commands.
> It doesn't look like any of the above 3 lines do all these 4 requirements.
>
>
> Yuri
>
>
>
>

Reply via email to