What is the syntax of "expr" command?
Answers were Sorted based on User's Feedback
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 |
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 |
how to delete all the files with extension .dat rom a directory tree from root to third level in a single unix command?
What's the difference between scripting and coding?
Why do we use shell scripting?
shell script for reverse the string
what is the difference between cmp and diff commands
In a file , how to retrieve the lines which are the multiples of 50 ? like 50,100,150th lines etc.
How to print the first array element?
What is meant by dos operating system?
Explain about stdin, stdout and stderr?
How to open a read-only file in the shell?
Write a shell script in Linux to shift all characters in a file forward by five characters. (Thus “a” becomes “f’”).
2 Answers Ignou, Tripura Info,
What is a file basename?