Pages

Changing the delimiter of read

The read command is used to accept value for a variable as input. Read,by default, continues to accept input untill the return key is not pressed. Thus the return key acts are the delimiter.

The delimiter can be set to any other chatacter we want by using the option "-d" with read.
i.e.



For example :



In the above case "," will act as the delimiter and read will stop accepting input as soon as "," is entered.

No comments:

Post a Comment