So, I want to make a factorial command for the linux terminal, and I want to be able to run it like this:
$ factorial 5
120
However, when I look at questions about this, I only see commands that runs a SET of commands, like for example a command that changes your directory to ~/Downloads
and echoes "Went to Downloads!"
How can I make the factorial function as a command, and if this is a duplicate, could you at least tell me why it is a duplicate?
factorial 5
, you would just want afor
loop that contained a multiply operation, and counted up to 5.