Translation

If you are interested and you would read the post in English, please use Google Translator. You can find it on right side. If the translation is wrong, please email me: I'll try to translate for you.

martedì, agosto 23, 2011

Unix profile: setsid

Al fine di personalizzare l'utente oracle, all'interno del "profile", definiamo la funzione setsid

typeset -fx setsid
setsid()
{
_sidName=$(echo $1 |sed -e "s/\(^.*\)\(.\)/\1/")
_sidType=$(echo $1 |sed -e "s/\(^.*\)\(.\)/\2/")
_sidUpperName=$(echo ${_sidName} |tr '[:lower:]' '[:upper:]')
_sidLowerType=$(echo ${_sidType} |tr '[:upper:]' '[:lower:]')

echo ${_sidUpperName}${_sidLowerType}
}

Questo è un esempio di output

$> setsid VasMsrt
VASMSRt

Lo scopo di questa funzione è di rendere ORACLE_SID nel seguente formato:

ORACLE_SID ::= <logical_name><type>

dove


<logical_name>
è una stringa che identifica l'applicazione

<type>
può assumere 3 valori:

  • t -> test
  • d -> develop
  • p -> production

0 commenti: