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

wats the she bang statment with syntax?

3 Answers  


How are shells born?

0 Answers  


write a shell program to check wheather a given string is pallindrome or not?

4 Answers  


How to include comments in your shell scripts?

3 Answers  


What is bourne shell scripting?

0 Answers  






c program which accept one argument as a directory name and prints all the file name along with its inode number and total count of the file in directory

1 Answers  


is this growing field and what is average package in this?

0 Answers  


What is an sh file?

0 Answers  


How do I run a powershell script?

0 Answers  


How to handle the delimiter unit seperator in Unix

2 Answers  


What is the syntax of "grep" command?

4 Answers  


What is the best scripting language?

0 Answers  


Categories