Você pode executar seu script por meio do verificador de shell :
$ shellcheck myscript
Line 7:
CIVIS(){ $e "\e[25l"}
^-- SC1009: The mentioned parser error was in this function.
^-- SC1073: Couldn't parse this brace group.
^-- SC1083: This } is literal. Check expression (missing ;/\n?) or quote it.
Line 23:
if [[$key = $ESC[A ]];then echo up;fi
^-- SC1035: You need a space after the [[ and before the ]].
Line 24:
if [[$key = $ESC[B ]];then echo dn;fi;}
^-- SC1035: You need a space after the [[ and before the ]].
Line 42:
if [[ $after -eq 0 ]] || [$before -eq $LM ];then
^-- SC1035: You need a space after the [ and before the ].
Line 56:
^-- SC1056: Expected a '}'. If you have one, try a ; or \n in front of it.
^-- SC1072: Missing '}'. Fix any mentioned problems and try again.
$
Como o verificador de shell nos diz que você precisa alterar a linha 7 de:
CIVIS(){ $e "\e[25l"}
para:
CIVIS(){ $e "\e[25l";}