Here's my take on it:
$ cd /opt/android-sdk/emulator $ mv emulator{,.orig} $ cat < emulator heredoc> #!/bin/sh heredoc> heredoc> QEMU_AUDIO_DRV=none `dirname $0`/emulator.orig "$@" heredoc> EOF $ chmod +x emulator