<commit_before>#!/bin/bash
####################################################################################################
# Atscan Install script.
# Install tool in linux os.
# Alisam Technology 2015
####################################################################################################
# PATHs:
# Parent directory => User choice.
# /inc/conf/atscan => /etc/bash_completion.d/atscan
# Bash link in /usr/bin/atscan
####################################################################################################
##
echo "[ ]====================================================================[ ]";
echo "[ ]                     ALISAM  TECHNOLOGY                             [ ]";
echo "[ ]                  Atscan Tool Install Script                        [ ]";
echo "[ ]====================================================================[ ]";
echo "";
if [ -d "/usr/bin/" ];
then
echo "[!] Install.sh install atscan tool in your system? [y/n]: ";
read baba
if [ $baba == "y" ] || [ $baba == "Y" ]; 
  then
    echo " "
  else
    echo "[!] Installation canceled!";
    exit
fi
current=`pwd`
if [ ! -d "$current/inc" ]; 
then 
  echo "[!] Please make sure you have inc/ directory in $current/!";
  exit 
fi
echo "[!] Where do you want to install ATSCAN?";
echo "[!] Set path or press enter to use default dir $current: "
read refdir
echo "[!] Checking directories..."
if [ -d "$refdir/atscan" ] || [ -d "$refdir/ATSCAN" ];
then
echo "[!] A directory named ATSCAN was found $refdir/atscan/! Do you want to replace it? [y/n]: "
read mama
if [ $mama == "y" ] || [ $mama == "Y" ]; 
then
 rm -R "$refdir/atscan"
else
 echo "[!] Installation canceled!";
 exit
fi
fi

 echo "[!] Installing ...";
 echo "";
 git clone https://github.com/AlisamTechnology/ATSCAN.git $refdir/atscan;
 echo "#!/bin/bash 
 perl $refdir/atscan/atscan.pl" '${1+"$@"}' > atscan;
 chmod +x atscan;
 sudo cp atscan /usr/bin/;
 rm atscan;
 if [ -d "/etc/bash_completion.d" ] ;
 then
   chmod +x $refdir/atscan/inc/conf/atscan;
   sudo cp $refdir/atscan/inc/conf/atscan /etc/bash_completion.d/;
 fi
 echo "[!] Removing install files ...";
 rm $refdir/atscan/inc/conf/atscan;
 rm $refdir/atscan/install.sh;

if [ -d "$refdir/atscan" ] ;
then
chmod +x $refdir/atscan/inc/conf/version.log;
echo "" >> $refdir/atscan/inc/conf/version.log;
. ~/.bashrc;
atscan --update;
else
  echo "[!] Installation faid!! ";
  exit
fi
else
echo "Tool can be installed on your system! Use it as portable!";
fi<commit_msg>Add support to old versions<commit_after>#!/bin/bash
####################################################################################################
# Atscan Install script.
# Install tool in linux os.
# Alisam Technology 2015
####################################################################################################
# PATHs:
# Parent directory => User choice.
# /inc/conf/atscan => /etc/bash_completion.d/atscan
# Bash link in /usr/bin/atscan
####################################################################################################
##
echo "[ ]====================================================================[ ]";
echo "[ ]                     ALISAM  TECHNOLOGY                             [ ]";
echo "[ ]                  Atscan Tool Install Script                        [ ]";
echo "[ ]====================================================================[ ]";
echo "";
if [ -d "/usr/bin/" ];
then
echo "[!] Install.sh install atscan tool in your system? [y/n]: ";
read baba
if [ $baba == "y" ] || [ $baba == "Y" ]; 
  then
    echo " "
  else
    echo "[!] Installation canceled!";
    exit
fi
current=`pwd`
if [ ! -d "$current/inc" ]; 
then 
  echo "[!] Please make sure you have inc/ directory in $current/!";
  exit 
fi
echo "[!] Where do you want to install ATSCAN?";
echo "[!] Set path or press enter to use default dir $current: "
read refdir
echo "[!] Checking directories..."
if [ -d "$refdir/atscan" ] || [ -d "$refdir/ATSCAN" ];
then
echo "[!] A directory named ATSCAN was found $refdir/atscan/! Do you want to replace it? [y/n]: "
read mama
if [ $mama == "y" ] || [ $mama == "Y" ]; 
then
 rm -R "$refdir/atscan"
else
 echo "[!] Installation canceled!";
 exit
fi
fi

 echo "[!] Installing ...";
 echo "";
 git clone https://github.com/AlisamTechnology/ATSCAN.git $refdir/atscan;
 echo "#!/bin/bash 
 perl $refdir/atscan/atscan.pl" '${1+"$@"}' > atscan;
 chmod +x atscan;
 sudo cp atscan /usr/bin/;
 rm atscan;
 if [ -d "/etc/bash_completion.d" ] ;
 then
   chmod +x $refdir/atscan/inc/conf/atscan;
   sudo cp $refdir/atscan/inc/conf/atscan /etc/bash_completion.d/;
 fi
 echo "[!] Removing install files ...";
 rm $refdir/atscan/inc/conf/atscan;
 rm $refdir/atscan/install.sh;

if [ -d "$refdir/atscan" ] ;
then
chmod +x $refdir/atscan/inc/conf/version.log;
echo "" >> $refdir/atscan/inc/conf/version.log;
echo "[!] Tool successfully installed";
echo "[!] Updating tool.. ";
sleep 2;
. ~/.bashrc;
atscan --update;
else
  echo "[!] Installation faid!! ";
  exit
fi
else
echo "Tool can be installed on your system! Use it as portable!";
fi
{'fraction_non_alphanumeric': 0.3172318611987382, 'fraction_numerical': 0.002168769716088328, 'mean_word_length': 3.624430264357338, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1811723', 'n_tokens_mistral': 1649, 'n_tokens_neox': 1557, 'n_words': 444}