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 |
What is sh in shell script?
What is inside a seashell?
How Connect to a Database in Shell Programming?
What is the significance of the shebang line in shell scripting?
How do you rename the files(*.sh) with file names containing space in it?for example "interview question.sh" needs to rename to "interview-question.sh". Appreciate your inputs.Thanks.
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 shell? · Types of shell · what is shell scripting?
Where is bash history?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
What is the basic difference you find between a shell script and perl?
What is Linux language details
How to check if the previous command was run successfully?