short_link — Скрипт сокращения ссылок
Published in
Jan 2, 2023
script
#!/bin/bash
echo -n "Enter the Long URL : "
read url
short_url=$(curl -s http://tinyurl.com/api-create.php?url=${url})
# вывод в терминал
echo "Short URL is : ${short_url}"
# копирование в буфер обмена
echo -n "${short_url}" | xsel -b -i
read
exit 0
file name
short_link.sh
Права доступа / Access rights
chmod +x short_link.sh
alias in .bashrc
alias short="/home/sollus/.config/awesome/scripts_myaw/short_url.sh"
long URL
https://www.dropbox.com/s/25o0i58oprrl9uv/3%20cat%203%20%D0%BA%D0%BE%D1%82%D0%B0.jpg?dl=0
create short url
short
Enter the Long URL : https://www.dropbox.com/s/25o0i58oprrl9uv/3%20cat%203%20%D0%BA%D0%BE%D1%82%D0%B0.jpg?dl=0
Short URL is : https://tinyurl.com/2klqedox
and short url copy to clipboard (can be inserted ctrl+v)
https://tinyurl.com/2klqedox