fix scripts

This commit is contained in:
thek4n 2026-05-22 15:28:08 +03:00
parent 11dfbb1ce6
commit ed8d3a6afe
40 changed files with 45 additions and 109 deletions

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
codes="10-0 - Офицер ранен codes="10-0 - Офицер ранен
10-1 - Офицеру нужна помощь 10-1 - Офицеру нужна помощь

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
ends_with_bak() { ends_with_bak() {
case "${1}" in case "${1}" in

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eum
set -eum
if test -t 1; then if test -t 1; then
exec 1>/dev/null exec 1>/dev/null

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
directory="$(realpath "${1}")" directory="$(realpath "${1}")"

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
directory="$(realpath "${1}")" directory="$(realpath "${1}")"

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
readonly downloads_directory="${XDG_DOWNLOAD_DIR}" readonly downloads_directory="${XDG_DOWNLOAD_DIR}"
cleanup-directory-log "${downloads_directory}" cleanup-directory-log "${downloads_directory}"

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
case "${OSTYPE:-}" in case "${OSTYPE:-}" in

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
readonly filename="${1}" readonly filename="${1}"

View File

@ -1,8 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -ue
readonly project_name="${1}" readonly project_name="${1}"

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
emoji="😀 grinning cheerful cheery face grin grinning face happy laugh nice smile smiling teeth emoji="😀 grinning cheerful cheery face grin grinning face happy laugh nice smile smiling teeth
😃 smiley awesome face grin happy mouth open smile smiling smiling face with open mouth teeth yay 😃 smiley awesome face grin happy mouth open smile smiling smiling face with open mouth teeth yay

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
if [ -z "${1}" ]; then if [ -z "${1}" ]; then

View File

@ -1,4 +1,3 @@
#!/bin/sh #!/bin/sh -eu
set -eu
firefox --new-instance -P media --name firefox_media firefox --new-instance -P media --name firefox_media

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -ue
LC_ALL=C LC_ALL=C
DEFAULT_PASSWORD_LENGTH=20 DEFAULT_PASSWORD_LENGTH=20

View File

@ -1,5 +1,3 @@
#!/bin/sh #!/bin/sh -eu
set -ue
dd if=/dev/urandom count=16 2>/dev/null | sha256sum | head -c 64 dd if=/dev/urandom count=16 2>/dev/null | sha256sum | head -c 64

View File

@ -1,4 +1,3 @@
#!/bin/sh #!/bin/sh -eu
set -eu
go build -v "${@}" -o ./bin/ ./... go build -v "${@}" -o ./bin/ ./...

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
ESC=$(printf '\033') ESC=$(printf '\033')

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
statuses="100 Continue - Разрешение клиенту на продолжение отправки. statuses="100 Continue - Разрешение клиенту на продолжение отправки.
101 Switching Protocols - Переключение протоколов, исходя из указаний клиента. 101 Switching Protocols - Переключение протоколов, исходя из указаний клиента.

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
if [ -t 0 ]; then if [ -t 0 ]; then
echo "${@}" | python3 -m json.tool --no-ensure-ascii echo "${@}" | python3 -m json.tool --no-ensure-ascii

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
readonly name="${1}"; shift readonly name="${1}"; shift

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
SOCKET_PATH="/tmp/mpv-${USER}.sock" SOCKET_PATH="/tmp/mpv-${USER}.sock"

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
if [ ! -e "${1}" ]; then if [ ! -e "${1}" ]; then
printf 'File %s not found' "${1}" >&2 printf 'File %s not found' "${1}" >&2

View File

@ -1,7 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
case "${OSTYPE:-}" in case "${OSTYPE:-}" in
"linux-gnu"*) "linux-gnu"*)

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
trap 'exit 0' INT trap 'exit 0' INT

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
PROG="$(basename "${0}")" PROG="$(basename "${0}")"
SOCKET_PATH="/tmp/mpv-${USER}.sock" SOCKET_PATH="/tmp/mpv-${USER}.sock"

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
if [ -z "${*}" ] && [ -x "$(command -v ipython 2>/dev/null)" ]; then if [ -z "${*}" ] && [ -x "$(command -v ipython 2>/dev/null)" ]; then
ipython -i -c "q = exit" ipython -i -c "q = exit"

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
channel="${1:-}" channel="${1:-}"

View File

@ -1,4 +1,3 @@
#!/bin/sh #!/bin/sh -eu
set -eu
gio trash "${@}" gio trash "${@}"

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
file="$(mktemp)" file="$(mktemp)"
echo "Editing ${file}" echo "Editing ${file}"

View File

@ -1,6 +1,4 @@
#!/usr/bin/env zsh #!/usr/bin/env -S zsh -euo pipefail
set -euo pipefail
readonly LOG_FILE="${HOME}/.screenshots.log" readonly LOG_FILE="${HOME}/.screenshots.log"
readonly NOTIFY_TIME_LOW_MS=1500 readonly NOTIFY_TIME_LOW_MS=1500

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
PROGRAM="$(basename "${0}")" PROGRAM="$(basename "${0}")"

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
if [ -n "${2+x}" ]; then if [ -n "${2+x}" ]; then
shasum -a 256 "${@}" shasum -a 256 "${@}"

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
readonly tips_dir="${HOME}/.tips" readonly tips_dir="${HOME}/.tips"

View File

@ -1,7 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
if [ ! -e "${1}" ]; then if [ ! -e "${1}" ]; then
echo "file '${1}' not found" >&2 echo "file '${1}' not found" >&2

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
cd "${HOME}/Games/starsector" cd "${HOME}/Games/starsector"
./starsector.sh ./starsector.sh

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
sleep "${@}" sleep "${@}"

View File

@ -1,8 +1,6 @@
#!/bin/sh #!/bin/sh -u
# Выполнять, пока команда падает # Выполнять, пока команда падает
set -u
while ! "${@}" ; do while ! "${@}" ; do
sleep 0.5 sleep 0.5
done done

View File

@ -1,8 +1,6 @@
#!/bin/sh #!/bin/sh -u
# Выполнять, пока команда не упадет. # Выполнять, пока команда не упадет.
set -u
while "${@}"; do while "${@}"; do
sleep 0.5 sleep 0.5
done done

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
if "${@}"; then if "${@}"; then
beep -f 800 -l 250 -n -f 1000 -l 500 beep -f 800 -l 250 -n -f 1000 -l 500

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -eu
readonly city="${1}" readonly city="${1}"
curl "wttr.in/${city}" 2>/dev/null | head -n -1 curl "wttr.in/${city}" 2>/dev/null | head -n -1

View File

@ -1,6 +1,4 @@
#!/bin/sh #!/bin/sh -eu
set -ue
readonly TARGET_PATH="${HOME}" readonly TARGET_PATH="${HOME}"