commit 30059c7573ef92f5715cf135d67afa4e1f0ac529
parent d6ba0d2a072e0653fe7d9b997ad149390c973b8d
Author: hhvn <dev@hhvn.uk>
Date: Mon, 28 Jun 2021 00:02:23 +0100
.s/b/{netdownload,netimg,netpdf}: compact random string
Diffstat:
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.scripts/bin/netdownload b/.scripts/bin/netdownload
@@ -5,7 +5,7 @@ input=$(printf "no\nyes\n" | dmenu -i -p "Download: $1")
file="$HOME/general/downloads/$(echo "$1" | tr '/' '+')"
while [ -f $file ]
do
- file="$HOME/general/downloads/$(head -n 5 /dev/urandom | base64 | tr '/' '+' | tr -d '\n' | cut -c-10)"
+ file="$HOME/general/downloads/$(base64 </dev/urandom | tr '/' '+' | head -c10)"
done
curl "$(echo "$1" | sed -E 's/]|\[|}|\{/\\&/g')" > "$file"
herbe "Saved to: $file"
diff --git a/.scripts/bin/netimg b/.scripts/bin/netimg
@@ -3,10 +3,10 @@
while [ $# != 0 ]
do
- file="/tmp/netimg.$(head -n 5 /dev/urandom | base64 | tr '/' '+' | tr -d '\n' | cut -c-10)"
+ file="/tmp/netimg.$(base64 </dev/urandom | tr '/' '+' | head -c10)"
while [ -f $file ]
do
- file="/tmp/netimg.$(head -n 5 /dev/urandom | base64 | tr '/' '+' | tr -d '\n' | cut -c-10)"
+ file="/tmp/netimg.$(base64 </dev/urandom | tr '/' '+' | head -c10)"
done
curl -kL "$1" > "$file"
diff --git a/.scripts/bin/netpdf b/.scripts/bin/netpdf
@@ -3,10 +3,10 @@
while [ $# != 0 ]
do
- file="/tmp/netpdf.$(head -n 5 /dev/urandom | base64 | tr '/' '+' | tr -d '\n' | cut -c-10)"
+ file="/tmp/netpdf.$(base64 </dev/urandom | tr '/' '+' | head -c10)"
while [ -f $file ]
do
- file="/tmp/netpdf.$(head -n 5 /dev/urandom | base64 | tr '/' '+' | tr -d '\n' | cut -c-10)"
+ file="/tmp/netpdf.$(base64 </dev/urandom | tr '/' '+' | head -c10)"
done
curl -L "$1" > "$file"