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 bourne shell scripting?

0 Answers  


What's the difference between scripting and coding?

0 Answers  


What does $1 mean in bash?

0 Answers  


What does sh mean?

0 Answers  


What is a scripting language simple definition?

0 Answers  






What is the syntax of "grep" command?

4 Answers  


What is use of "cut" command?

3 Answers  


Why is a script important?

0 Answers  


determine the output of the following command: echo ${new:-variable}

0 Answers  


What command needs to be used to take the backup?

0 Answers  


Can you write a script to portray how set –x works?

0 Answers  


Where cron file kept?

2 Answers   Tech Mahindra,


Categories