Question: How to check length of arguments in bash script ? For example: we have a script called lengthof.args that will display length of arguments, so

How to check length of arguments in bash script ?

For example: we have a script called "lengthof.args" that will display length of arguments, so when we call

lengthof.args '' should display 0

lengthof.args abc should display 3

lengthof.args ' 3x3 spaces ' should display 18 (including spaces)

Use while loop or for loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!