<commit_before>#!/bin/sh 
# vim: set ts=2 sw=2 sts=2 si ai et: 

# libutils.sh -- library with some util functions
# =-=
# Developer
# <NAME> <<EMAIL>>
# 

#
# constants
# initialize app enviroment
APSYSO="`uname -s`"
APHOST=`hostname | sed -e "s/\..*//g"`
APUSER=`id -u -n`
APDATE=`date "+%Y%m%d"`
APHOUR=`date "+%H%M"`
APLEVL="DEBUG"

# globals
export APLOGS=
export APLOGP=
export APLOGT=
export APPRCS=
APFLTR=

#
# get the enviroment for the SO running
set_environment () {
  # terminal line settings
  stty 2> /dev/null > /dev/null 

  if [ "$?" = "0" ]
  then
    # terminal line settings
    stty erase '^?'
    stty intr '^C' 
    stty kill '^U' 
    stty stop '^S'
    stty susp '^Z'
    stty werase '^W'

    # workaround
    CLTYPE="\e"
    [ "${APSYSO}" = "HP-UX" ] && CLTYPE="\033"
 
    # command line _eye candy_
    CCLEAR="${CLTYPE}[0m"
    CGRAY="${CLTYPE}[01;30m"
    CRED="${CLTYPE}[01;31m"
    CGREEN="${CLTYPE}[01;32m"
    CYELLOW="${CLTYPE}[01;33m"
    CBLUE="${CLTYPE}[01;34m"
    CWHITE="${CLTYPE}[01;37m"
  else
    # command line _eye candy_
    CCLEAR=
    CWHITE=
    CRED=
    CGREEN=
    CYELLOW=
    CBLUE=
    CGRAY=
  fi
  
  # application's structure
  # [monopse]
  # /opt/usrapp/monopse

  # applications's name
  if [ ${#APNAME} -eq 0 ]
  then
    APNAME="`basename ${0}`"
    APNAME="${APNAME%.*}"
  fi

  # application's path
  if [ ${#APPATH} -eq 0 ]
  then
    APPATH=${APHOME}/${APNAME}
  fi
  [ ! -d ${APPATH} ] && mkdir -p ${APPATH}
  APPROF="`cat ${APPATH}/PROFILE`"

  # log's path
  if [ ${#APLOGD} -eq 0 ]
  then
    APLOGD=${APPATH}/logs
    log_action "DEBUG" "APLOGD unset, using default values: ${APLOGD}"
  fi
  APLOGS=${APLOGD}/${APNAME}
  APTEMP=${APLOGD}/temp
  APLOGP=${APTEMP}/${APNAME}
  [ ! -d ${APLOGD} ] && mkdir -p ${APLOGD}
  [ ! -d ${APTEMP} ] && mkdir -p ${APTEMP}
  
  HOSTNAME=`hostname`
  case "${APSYSO}" in
    "HP-UX")
      PSOPTS="-l -f -a -x -e"
      PSPOS=1
      DFOPTS="-P -k"
      MKOPTS="-d /tmp -p "
      APUSER=`id -u -n`
      ECOPTS=""
      PING="`which ping`"
      PINGPARAMS="-n"
      IFCONFIG="`which ifconfig`"
      IFPARAMS="lan"
      MAIL=`which mailx`<commit_msg>TASK: fix APPROF, its not a part of soya package<commit_after>#!/bin/sh 
# vim: set ts=2 sw=2 sts=2 si ai et: 

# libutils.sh -- library with some util functions
# =-=
#
# Developer
# <NAME> <<EMAIL>>
# 

#
# constants
# initialize app enviroment
APSYSO="`uname -s`"
APHOST=`hostname | sed -e "s/\..*//g"`
APUSER=`id -u -n`
APDATE=`date "+%Y%m%d"`
APHOUR=`date "+%H%M"`
APLEVL="DEBUG"

# globals
export APLOGS=
export APLOGP=
export APLOGT=
export APPRCS=
APFLTR=

#
# get the enviroment for the SO running
set_environment () {
  # terminal line settings
  stty 2> /dev/null > /dev/null 

  if [ "$?" = "0" ]
  then
    # terminal line settings
    stty erase '^?'
    stty intr '^C' 
    stty kill '^U' 
    stty stop '^S'
    stty susp '^Z'
    stty werase '^W'

    # workaround
    CLTYPE="\e"
    [ "${APSYSO}" = "HP-UX" ] && CLTYPE="\033"
 
    # command line _eye candy_
    CCLEAR="${CLTYPE}[0m"
    CGRAY="${CLTYPE}[01;30m"
    CRED="${CLTYPE}[01;31m"
    CGREEN="${CLTYPE}[01;32m"
    CYELLOW="${CLTYPE}[01;33m"
    CBLUE="${CLTYPE}[01;34m"
    CWHITE="${CLTYPE}[01;37m"
  else
    # command line _eye candy_
    CCLEAR=
    CWHITE=
    CRED=
    CGREEN=
    CYELLOW=
    CBLUE=
    CGRAY=
  fi
  
  # application's structure
  # [monopse]
  # /opt/usrapp/monopse

  # applications's name
  if [ ${#APNAME} -eq 0 ]
  then
    APNAME="`basename ${0}`"
    APNAME="${APNAME%.*}"
  fi

  # application's path
  if [ ${#APPATH} -eq 0 ]
  then
    APPATH=${APHOME}/${APNAME}
  fi
  [ ! -d ${APPATH} ] && mkdir -p ${APPATH}
  [ -s ${APPATH}/PROFILE ] && APPROF="`cat ${APPATH}/PROFILE`" || APPROF="(c) 2011, <NAME> <<EMAIL>>"

  # log's path
  if [ ${#APLOGD} -eq 0 ]
  then
    APLOGD=${APPATH}/logs
    log_action "DEBUG" "APLOGD unset, using default values: ${APLOGD}"
  fi
  APLOGS=${APLOGD}/${APNAME}
  APTEMP=${APLOGD}/temp
  APLOGP=${APTEMP}/${APNAME}
  [ ! -d ${APLOGD} ] && mkdir -p ${APLOGD}
  [ ! -d ${APTEMP} ] && mkdir -p ${APTEMP}
  
  HOSTNAME=`hostname`
  case "${APSYSO}" in
    "HP-UX")
      PSOPTS="-l -f -a -x -e"
      PSPOS=1
      DFOPTS="-P -k"
      MKOPTS="-d /tmp -p "
      APUSER=`id -u -n`
      ECOPTS=""
      PING="`which ping`"
      PINGPARAMS="-n"
      IFCONFIG="`which ifconfig`"
      IFPARAMS="lan"
      MAIL=`which mailx`
{'fraction_non_alphanumeric': 0.1931407942238267, 'fraction_numerical': 0.018050541516245487, 'mean_word_length': 2.6788381742738587, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1911812', 'n_tokens_mistral': 1985, 'n_tokens_neox': 1884, 'n_words': 418}