Quote Originally Posted by kl522 View Post
Why don't you change it to accept both 400 ***AND*** 400MB ?

You can consider using sed to accomplish the job :-

Code:
               $ echo 400MB | sed "s/[^0-9]//g"
                400
Code:
                $ echo 400MB | sed "s/[0-9]//g"
                MB
By using sed, you can extract the number portion of the user input. If the user input something else other than 400MB and 400, you might want to prompt for error.
This seems like a good addition, esp. for newbies; the prompt could say "Enter size (MB):"

Cheers!
Krishna