Thanks for the code Matt.
I will try this.
By 'execute' I mean generate
${cmd}
then execute/do whatever ${cmd} turns out to be.On Mon, Aug 2, 2021 at 8:35 AM matthew sporleder <[email protected]> wrote: > > On Mon, Aug 2, 2021 at 8:23 AM Todd Gruhn <[email protected]> wrote: > > > > I am attempting to write some ksh-scripts that invoke "borg" . > > How does one tell ksh to cat the 2 vars together and invoke the > > resulting command? > > > > $foo <--> /umass1/BORG-REPOS > > $FIRSThalf <--> borg-3.8 list > > $cmd= $FIRSThalf . $foo #thats how it is coded in PERL > > > > execute $cmd > > > > I never learned much about /bin/ksh -- I jumped straight into PERL. > > Anyone know of some good PDFs regarding this? > > > > Any help will be appreciated. > > > foo="ls" > bar="/tmp" > cmd="${foo} ${bar}" > ${cmd} #runs ls /tmp > --- > output=$(${foo} ${bar}) #captures the output > > not sure what "execute" is here > > Your perl code wouldn't work because you don't have spaces using the `.` > > working perl (looks just like the shell script): > perl -e '$foo = "ls"; $bar = "/tmp"; $cmd = "${foo} ${bar}"; print qx#$cmd#;'
