I want my script to be able to take an optional input,
e.g. currently my script is
#!/bin/bash
somecommand foo
but I would like it to say:
#!/bin/bash
somecommand [ if $1 exists, $1, else, foo ]
This question is related to
bash
arguments
parameter-passing
Source: Stackoverflow.com