| Server IP : 93.86.61.54 / Your IP : 216.73.216.156 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/projects/nextcloud/apps/spreed/sample-commands/ |
Upload File : |
#!/usr/bin/env bash
CALCULATOR=$(which "bc")
if ! [ -x "$CALCULATOR" ]; then
echo "Basic calculator package (bc - https://www.gnu.org/software/bc/) not found"
exit 1
fi
while test $# -gt 0; do
case "$1" in
--help)
echo "/calc - A basic calculator for Nextcloud Talk based on gnu BC"
echo "See the official documentation for more information:"
echo "https://www.gnu.org/software/bc/manual/html_mono/bc.html"
echo " "
echo "Simple equations: /calc 3 + 4 * 5"
echo "Complex equations: /calc sin(3) + 3^3 * sqrt(5)"
exit 0
;;
*)
break
;;
esac
done
set -f
echo "$@ ="
echo $(echo "$@" | bc)