Generate shell hooks dynamically for Unix/Windows portability