I made a basic bash script piping fortune and cowsay to make a wise cow, and titled it appropriately as wisecow Is there a way I can enable the flags associated with cowsay so that I can input
wisecow -s
and get the stoner cow, or -b for the borg cow, or what have you?
Currently when I do
wisecow -d
or whatever, the cow looks the same as if I hadn't used the flag
the code lol:
#!/bin/bash
fortune | cowsay

getoptsso that your script can process its arguments and you can pass them on to whichever command. Search here and Stack Overflow for getopts, there are loads of examples.