View shell_escape.c
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
/**
* Escapes a string for use with bash shell, formatted as $'...'.
*
* @param input the input string you want to escape.
*
* @return the escaped string (which must be free'd after use).