What is the syntax of "expr" command?

Answer Posted / swaroopa

while [ $num -gt 0 ]
do
i=`expr $i \* 10 + $num % 10`
num=`expr $num / 10`
done

Is This Answer Correct ?    35 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.

889


What is bash used for?

660


What is the use of echo in shell script?

634


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

719


Explore about environment variables?

678






What is a shell in operating system?

666


When should shell programming/scripting not be used?

681


Write a script to print the first 10 elements of fibonacci series.

1939


how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?

3705


What is bourne shell scripting?

614


What can scripts do?

733


What is the use of "$#" in shell scripting?

623


How can any user find out all information about a specific user like his default shell, real-life name, default directory, when and how long he has been using the system?

794


How do I open the shell prompt?

681


Why are there shells on the beach?

683