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

What is the basic difference you find between a shell script and perl?

3 Answers   Yahoo,


What is the difference between a shell variable that is exported and the one that is not exported?

6 Answers  


How to print some text on to the screen?

2 Answers  


What language is used in terminal?

0 Answers  


how will you find the total disk space used by a specific user?

0 Answers  






what is the meaning of First line of shell script ,what is meaning of #! pleas explain brifly

4 Answers  


How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output of ls -l command.

6 Answers   TCS,


What is MUTEX?

1 Answers  


How Connect to a Database in Shell Programming?

4 Answers   Syntel,


What language is bash?

0 Answers  


What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?

0 Answers  


Explain about gui scripting?

0 Answers  


Categories