Requirement:
- bc package
How to:
- Install bc package
$ sudo apt-get install bc
- Create shell script, name it ‘solve.sh’
$ nano solve.sh
And type in these lines:
#!/bin/sh bc << EOF scale=4 $@ quit EOF
- Test the script
$ sh solve.sh 2+2 4
- Create alias ‘solve’
$ alias solve="sh /home/user/solve.sh"
- Test again using alias
$ solve 2^3 8