Strip Line Feed from the Kshell Variable

Strip Line Feed from the Kshell Variable

Post by BN.Sar » Thu, 26 Sep 2002 04:59:38



Greetings

I am using Ksh98, I will be using this script in AIX and SUN boxes

Here is what I am doing in the script:

SPid=$( echo " $SYSTEM
        set heading off feedback off verify off timing off
        select spid from v\$process  where addr=(select paddr from
v\$session  where audsid=userenv('sessionid'));
        alter database backup controlfile to trace;
        alter database backup controlfile to '$Backup_CTL_File';"|
sqlplus -s )
CTL_TraceFile=ora_${SPid}_${GN}.trc

(/u001/bin)echo "$SPid" |od -a
0000000   lf   1   9   8   5   4  lf
0000007
(/u001/bin)echo $SPid |od  
0000000  030471 034065 032012
0000006
(/u001/bin)echo $SPid |od -c            
0000000    1   9   8   5   4  \n
0000006

my file looks like this:
ora_
19936
_nb.trc

I want the file name to be ora_19936_nb.trc.

Please help

Regards & Thanks
BN