aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--%HOME%/.bash_utils/file.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/%HOME%/.bash_utils/file.sh b/%HOME%/.bash_utils/file.sh
index ba58031..351b962 100644
--- a/%HOME%/.bash_utils/file.sh
+++ b/%HOME%/.bash_utils/file.sh
@@ -37,3 +37,19 @@ swap_files() (
mv -- "$path2" "$path1"
mv -- "$tmp_path" "$path2"
)
+
+pastebin() (
+ set -o errexit -o nounset -o pipefail
+ shopt -s inherit_errexit
+
+ if [ "$#" -ne 1 ]; then
+ echo "usage: ${FUNCNAME[0]} PATH" >&2
+ return 1
+ fi
+
+ local path="$1"
+
+ # Use the .txt file extension so that when you open a link, it displays
+ # the contents instead of downloading.
+ curl -sS --connect-timeout 5 -F "file=@$path;filename=.txt" https://x0.at/
+)