kristopolous / TickTick

JSON in your Bash scripts
http://9ol.es/TheEmperorsNewClothes.html
Other
579 stars 55 forks source link

Support Solaris/BSD (simple change needed) #26

Closed phansson closed 11 years ago

phansson commented 11 years ago

The TickTick.sh script depends on GNU grep so it will not work on Solaris unless the following is added to the script:

# Script needs the GNU version of 'grep' !!
# Set up some defaults:
GREP=grep
EGREP=egrep

if [ `uname` == "SunOS" ]; then
  GREP=ggrep
  EGREP=gegrep
fi

Then everywhere in the script where 'grep' or 'egrep' is used I've replaced with $GREP and $EGREP.

Note to those who may find this posting:

On Solaris 10 GNU grep is installed by default and lives in /usr/sfw/bin. Note that the binaries have a prefixed 'g'.

On Solaris 11 GNU grep is installed by default in global zones but doesn't (by default) make it into the local zones. To install in local zone simply do 'pkg install gnu-grep'. In Solaris 11 the GNU tool chain is already part of the default path but with a 'g' prefixed on the binary (except for the cases where there's no name clash)

kristopolous commented 11 years ago

This looks valid. I'll test it today.

kristopolous commented 11 years ago

the sunos system I have access to doesn't have these tools installed ... what a PITA. Are you using genuine SunOS 5.11 or one of the one of the spinoffs like openindiana or nexenta? I'll try to get a VirtualBox instance up of the system you are trying to use it on...

kristopolous commented 11 years ago

Otherwise if you can fork it, patch it, then send me the output of ./runall.sh in the tests folder, that would also be great.