need to act over several database clients, these client have a static name APPUSR with numbers (1,11,12,13 2,21,22,23 3,31,32,33 …) Id. APPUSR1 , APPUSR12 APPUSR3 APPUSR32
I thought loop trhu the tens and other loop for units to create the connection name
#!/usr/bin/tcsh
set echo
foreach envMast ( seq 4
)
foreach envClient ( seq 0 3
)
if ( “$envClient” == 0) then
set envClient = “” #there is not user 10,20,30 so i blank unit 0 to get envMast 1 2 3 4
endif
echo sqlplus APPUSR${envMast}${envClient}/APPUSR${envMast}${envClient}@DB <<-EOT>APPUSR.log
SELECT USER FROM DUAL;
exit
EOT
end
end
It runs ok but only once for APPUSR1.
maybe a simple logic error (I’m newbie on tcsh) but have no idea why don’t iterate or loop in any of the foreach
Atropo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.