try .. exec 3> >( tee -a log ) # or 3>> . user.bash >&3 cmds ; cmds ; vars ; cmds
On Thu, Nov 14, 2024, 12:56 AM #!microsuxx <fxmb...@gmail.com> wrote: > u need to , save out of . script1 to log1 but what was your second > sentense alike of this first one ? > u run source over log1 to produce log2 ? > > i thought ur looking for errors and for this set -x and stderr ? no need > for both ? > > i need some details clarified .. > > On Thu, Nov 14, 2024, 12:48 AM Yuri <y...@rawbw.com> wrote: > >> Hi !microsuxx, >> >> >> But I need to save the output of the user script into a dedicated log >> file. >> This script should run, should save its output into a dedicated log, and >> then many other commands should use these environment variables. >> >> Their logs can't be combined into one. >> >> >> Yuri >> >> >> >> On 11/13/24 15:36, #!microsuxx wrote: >> > 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 >> >> >>