From 4965b1eddd3963c877f7c4c0a38c767fe8e20c25 Mon Sep 17 00:00:00 2001 From: tdro Date: Fri, 27 Nov 2020 21:29:51 -0500 Subject: .bashrc: Add shellquote function --- .bashrc | 3 +++ 1 file changed, 3 insertions(+) (limited to '.bashrc') diff --git a/.bashrc b/.bashrc index 696811b..e712296 100644 --- a/.bashrc +++ b/.bashrc @@ -121,5 +121,8 @@ history-remove-duplicates() { awk '!visited[$0]++' "$HOME/.bash_history" | spong # extract docker container as rootfs docker-rootfs() { id=$(docker run -d "$1" /bin/true) && docker export "$id" -o "$2.tar" && docker container rm "$id"; } +# https://til.simonwillison.net/bash/escaping-a-string +shellquote() { printf '%q\n' "$(cat)"; } + # swallow swallow() { "$@" & disown; exit; } -- cgit v1.2.3