0
1
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 d
abcd
Here is what my script looks like
#!/bin/bash
echo "abcd" | h a b c d
Exactly like the command typed in, but here is the output when running the script
root@kali:~# ./test.sh
./test.sh: line 1: h: command not found
How could this work when typing directly in the terminal, but not when having the exact same command in a bash script?
Does your script begin with
#!/bin/bash
? – wurtel – 2014-11-25T11:18:49.987I reworked the question to hopefully make more sense – Will Hughes – 2014-11-25T22:36:46.413
I'm voting to close this question since it's been asked & answered at http://unix.stackexchange.com/questions/169780/hhighlighter-wrapper-script-sayi%E2%80%8C%E2%80%8Bng-command-not-found
– Sathyajith Bhat – 2016-04-21T16:14:31.920