I wrote a command that performs a series of function. The command works this way
Case1: commandname option value
$0 $1 $2
It should also works this way
case 2: value | commandname option
In case 1, I refer to "value" in my script using parameter $2. I am not sure how to read or what parameter to use to refer to "value" when it's coming from a pipe. Any help will be appreciated.
Thanks
Case1: commandname option value
$0 $1 $2
It should also works this way
case 2: value | commandname option
In case 1, I refer to "value" in my script using parameter $2. I am not sure how to read or what parameter to use to refer to "value" when it's coming from a pipe. Any help will be appreciated.
Thanks