I have gotten the wrapper script 'hhighlighter' from https://github.com/paoloantinori/hhighlighter which colors anything you want in stdout. I followed the instructions about installing ack-grep, created alias for ack=ack-grep in ~/.bashrc, put the h() function in ~/.bashrc, everything works fine when typing in the terminal. But when putting the EXACT same commands in a bash script, it says command not found. I will give examples here...root@kali:~# echo abcd | h a b c dabcdHere is what my script looks like#!/bin/bash  echo abcd | h a b c dExactly like the command typed in, but here is the output when running the scriptroot@kali:~# ./test.sh./test.sh: line 1: h: command not foundHow could this work when typing directly in the terminal, but not when having the exact same command in a bash script? If my ~/.bashrc is needed or anything else is needed to solve this please let me know, its been going on 4 days now without figuring this out. 
'hhighlighter' wrapper script saying command not found
linux;bash;shell script;terminal;kali linux
The problem is: When bash is started non-interactively then it does not read ~/.bashrc.Thus you have to read h() from the script.If you want to use aliases in a script then you have toenable the use of aliases in the script with shopt -s expand_aliasesdefine the alias in the script.An alternative to an alias is defining a shell function (which works the same in interactive and non-interactive shells):foo () {  bar $@}But it is not possible to take over alias or function definitions from the running shell into a script as the shell running the script is re-initialized.