Shift and Read command line arguments.

Standard

Shift and Read

If we read from $1 and then shift once, then again read from $1 we will get the value of $2 before shifting, and shifting again will get the value of the actual $3 inside $1. Thus while the value $# is not zero we can iterate on a while loop get the value of $1 shift and again access $1 and get all the parameters.

Or even we could check if the current value of $1 is NULL or not to check for the termination of the loop.

320 total views, no views today

Test Clustered Network File Systems with BASH

Standard

381 total views, 0 views today