If you search on “bash twitter oauth” you’ll find some older examples. You’d probably be better using e.g. a Python or Ruby library to do the tweeting for you, and wrap it with a bash script if you feel comfortable with that. The tricky part is likely to be oauth handling.