If you save it as "ogvtogif" use like this:
$ ogvtogif file.ogv
_____________________________________________________________
#!/bin/bash_____________________________________________________________
INPUT_FILE=$1
FPS=8
TEMP_FILE_PATH="tmp.png"
ffmpeg -i $INPUT_FILE -vf fps=$FPS,palettegen $TEMP_FILE_PATH
ffmpeg -i $INPUT_FILE -i $TEMP_FILE_PATH -loop 0 -filter_complex "fps=$FPS,paletteuse" $INPUT_FILE.gif
rm $TEMP_FILE_PATH