Floating number in linux cell script
---How can I represent floating number in linux cell scripting---
I am working in bash cell code: echo "Enter basic salary:" read basic echo "HRA `expr 0.2 \* $basic`" Output shows: non-numeric arguments. << HELP >> |
Do you mean "shell"? There's no such thing as Linux cell scripting or the bash cell.
The shell can't operate on non-intergers, you'll need to pass it to something that can, such as bc: Code:
echo "0.2 * $basic" | bc -l |
You can also use GNU Octave. Have a look at this tutorial.
As an example, here is a script to convert a Xorg modeline into a framebuffer mode: Code:
#!/usr/bin/octave -q |
All times are GMT -5. The time now is 07:08 PM. |