If you get the error message export: Illegal option -f
or YOUR_SCRIPT_NAME: not found
from your script, it is likely that:
- You didn't put
#!/bin/bash
at the top of your script. Make sure that it is in every script files. - You call script using
sh
. Don't do that. Use./script.sh
instead ofsh YOUR_SCRIPT_NAME.sh