help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] Help With School Assignment, Learning Bash Scripts


From: nick
Subject: [Help-bash] Help With School Assignment, Learning Bash Scripts
Date: Wed, 05 Nov 2014 21:01:00 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

I am trying to feature out the below question and can't seem able to.
Cheers Nick 
The best approach is to check each positional parameter within the loop,
before the addition.

You will use an "echo" to display the value of the "number" variable,
and pipe the output into a "grep".  The "grep" should search for a single
character which is NOT a digit or a plus or minus sign.  A character class,
something like "[^0-9+-]" would be the easiest way to do this.

If the "grep" is successful, then the message should be displayed and the
script terminated.

Continue to the next step to see how to start.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]