What is the syntax of "expr" command?

Answers were Sorted based on User's Feedback



What is the syntax of "expr" command?..

Answer / 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

What is the syntax of "expr" command?..

Answer / jayachandran.g.r

it is used to use arithmatic operation in shell scripting

stntx: expr op1 opertor op2

where op1 and op2 may be any integer no(without any
decimalpoint)and operator can be
+ Addition
- Subtraction
/ division
% Modular
\* Multiplication


EX: $expr 1 + 3


o/p 4

Is This Answer Correct ?    31 Yes 18 No

Post New Answer

More Shell Script Interview Questions

I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?

0 Answers  


What is the first line of a shell script called?

0 Answers  


What will happen to my current process when I execute a command using exec?

0 Answers  


What lives in a shell?

0 Answers  


What is Linux language details

0 Answers   Quick Heal,






What is the default ubuntu terminal?

0 Answers  


how to create purchase order

2 Answers  


How to enable the shell to know what program should be run to interpret the script?

3 Answers  


how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com

0 Answers  


What is echo in shell?

0 Answers  


How do I run a powershell script?

0 Answers  


Why are there shells on the beach?

0 Answers  


Categories