[oracle@kvm00010 its]$ cat p.sh
pname=PDB01
sqlplus -S / as sysdba<<eof
alter session set container=$pname;
SHOW CON_NAME;
eof
[oracle@kvm00010 its]$ ./p.sh
Session altered.
Elapsed: 00:00:00.01
CON_NAME
------------------------------
PDB01
[oracle@kvm00010 its]$ cat p.sh
pname=PDB01
sqlplus -S / as sysdba<<eof
alter session set container=$pname;
SHOW CON_NAME;
eof
[oracle@kvm00010 its]$ ./p.sh
Session altered.
Elapsed: 00:00:00.01
CON_NAME
------------------------------
PDB01