-#!/system/bin/sh
+#!/bin/sh
show_usage () {
echo "usage: termux-share [options] [file]"
done
if [ $# -gt 1 ]; then echo "Only one file can be shared"; exit 1; fi
-if [ $# != 0 ]; then PARAMS="$PARAMS --es file `realpath $1`"; fi
-termux-api Share $PARAMS
+if [ $# != 0 ]; then
+ # Note that the file path can contain whitespace.
+ @TERMUX_API@ Share $PARAMS --es file "`realpath "$1"`"
+else
+ @TERMUX_API@ Share $PARAMS
+fi