From 173f842b9a96e39ae9f5e345fcf7d9fd992ce01b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 2 Aug 2025 10:05:13 +0200 Subject: [PATCH] for/in --- sh/core/shell.sh | 2 +- sh/crypt.sh | 2 +- sh/dev/test.sh | 2 +- sh/ffmpeg.sh | 18 +++++++++--------- sh/fs/lsblk.sh | 2 +- sh/lint/lint.sh | 10 +++++----- sh/lint/ruff.sh | 2 +- sh/log/log.sh | 2 +- sh/pm/apt.extra.sh | 2 +- sh/rescue/hetzner.sh | 14 +++++++------- sh/self.sh | 2 +- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sh/core/shell.sh b/sh/core/shell.sh index a2f0d7a..b7e2e57 100644 --- a/sh/core/shell.sh +++ b/sh/core/shell.sh @@ -80,7 +80,7 @@ rwx_shell_configure() { set \ "git" \ "tar" - for file in "${@}"; do + for file; do path="${root}/${file}" # shellcheck disable=SC1090 [ -f "${path}" ] && . "${path}" diff --git a/sh/crypt.sh b/sh/crypt.sh index ce348ab..7a85da3 100644 --- a/sh/crypt.sh +++ b/sh/crypt.sh @@ -66,7 +66,7 @@ rwx_crypt_setup() { rwx_log_error 2 "No files" [ "${action}" = "${action_open}" ] && pass_phrase="$(rwx_read_passphrase)" - for crypt_arg in "${@}"; do + for crypt_arg; do rwx_log_info crypt_file="${RWX_CRYPT_ROOT}/${crypt_arg}.qcow2" if [ -f "${crypt_file}" ]; then diff --git a/sh/dev/test.sh b/sh/dev/test.sh index 9db1c9c..d949ec4 100644 --- a/sh/dev/test.sh +++ b/sh/dev/test.sh @@ -56,7 +56,7 @@ rwx_test_doc() { "b" \ \ "rwx_install" - for item in "${@}"; do + for item; do echo rwx_code_doc "${item}" done diff --git a/sh/ffmpeg.sh b/sh/ffmpeg.sh index 529d6ba..26ad00b 100644 --- a/sh/ffmpeg.sh +++ b/sh/ffmpeg.sh @@ -39,7 +39,7 @@ usb-Generic_Blue_Microphones_2051BAB04XY8-00.analog-stereo" -ac "2" \ -ar "48000" local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } rwx_ffmpeg_input_dell_precision() { @@ -51,7 +51,7 @@ pci-0000_00_1f.3.analog-stereo" -ac "2" \ -ar "48000" local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } rwx_ffmpeg_input_file() { @@ -67,7 +67,7 @@ rwx_ffmpeg_input_file() { -to "${to}" fi local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } rwx_ffmpeg_input_hdmi() { @@ -81,7 +81,7 @@ rwx_ffmpeg_input_hdmi() { -pix_fmt "yuv420p" \ -i "${device}" local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } # ╭────────┬────────╮ @@ -93,7 +93,7 @@ rwx_ffmpeg_output_audio_fast() { -codec:a "flac" \ -compression_level "0" local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } rwx_ffmpeg_output_audio_slow() { @@ -101,7 +101,7 @@ rwx_ffmpeg_output_audio_slow() { -codec:a "libopus" \ -b:a "128k" local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } rwx_ffmpeg_output_file() { @@ -110,7 +110,7 @@ rwx_ffmpeg_output_file() { set -- \ -y "${file}" local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } rwx_ffmpeg_output_video_fast() { @@ -119,7 +119,7 @@ rwx_ffmpeg_output_video_fast() { -preset "ultrafast" \ -crf "0" local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } rwx_ffmpeg_output_video_slow() { @@ -140,7 +140,7 @@ rwx_ffmpeg_output_video_slow() { -movflags "+faststart" \ -pix_fmt "yuv420p" local argument - for argument in "${@}"; do echo "${argument}"; done + for argument; do echo "${argument}"; done } # ╭────────┬────────╮ diff --git a/sh/fs/lsblk.sh b/sh/fs/lsblk.sh index 690bd36..06cbf0b 100644 --- a/sh/fs/lsblk.sh +++ b/sh/fs/lsblk.sh @@ -25,7 +25,7 @@ rwx_list_block_no_empty() { rwx_list_block_output() { local argument local arguments="NAME" - for argument in "${@}"; do + for argument; do arguments="${arguments},${argument}" done rwx_list_block_no_empty \ diff --git a/sh/lint/lint.sh b/sh/lint/lint.sh index 365773f..fb1790b 100644 --- a/sh/lint/lint.sh +++ b/sh/lint/lint.sh @@ -8,7 +8,7 @@ rwx_lint() { "python" \ "shell" local code - for code in "${@}"; do + for code; do rwx_log "" "${code}" "rwx_lint_${code}" "${path}" done @@ -25,7 +25,7 @@ rwx_lint_clean() { "mypy" \ "ruff" local tool - for tool in "${@}"; do + for tool; do rwx_remove "${path}/.${tool}_cache" done } @@ -39,7 +39,7 @@ rwx_lint_python() { "pydoclint" \ "mypy" \ "ruff" - for action in "${@}"; do + for action; do rwx_log "" "${action}" "rwx_${action}" "${path}" done @@ -52,7 +52,7 @@ rwx_lint_shell() { set \ "shellcheck" \ "shfmt" - for action in "${@}"; do + for action; do rwx_log "" "${action}" "rwx_${action}" "${path}" done @@ -66,7 +66,7 @@ rwx_lint_tasks() { "LATER" \ "TODO" \ "FIXME" - for type in "${@}"; do + for type; do rwx_log "" "${type}" grep \ --after "1" \ diff --git a/sh/lint/ruff.sh b/sh/lint/ruff.sh index e15b701..faa0939 100644 --- a/sh/lint/ruff.sh +++ b/sh/lint/ruff.sh @@ -4,7 +4,7 @@ rwx_ruff() { set \ "check" \ "format" - for action in "${@}"; do + for action; do "rwx_ruff_${action}" "${path}" done } diff --git a/sh/log/log.sh b/sh/log/log.sh index 60c155c..087ae0a 100644 --- a/sh/log/log.sh +++ b/sh/log/log.sh @@ -28,7 +28,7 @@ _rwx_log() { shift [ ${#} -gt 0 ] || set -- "" local line - for line in "${@}"; do + for line; do [ -n "${prefix}" ] && printf "%s" "[${prefix}] " echo "${line}" diff --git a/sh/pm/apt.extra.sh b/sh/pm/apt.extra.sh index a975245..2b3f5fc 100644 --- a/sh/pm/apt.extra.sh +++ b/sh/pm/apt.extra.sh @@ -34,7 +34,7 @@ rwx_apt_install_target() { local target="${1}" shift local package - for package in "${@}"; do + for package; do rwx_log "" \ "${package} ← ${target}" apt-get \ diff --git a/sh/rescue/hetzner.sh b/sh/rescue/hetzner.sh index 24d6bd0..0ddfc94 100644 --- a/sh/rescue/hetzner.sh +++ b/sh/rescue/hetzner.sh @@ -12,7 +12,7 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { rwx_warn_wipe "${@}" # number=0 - for device in "${@}"; do + for device; do number=$((number + 1)) echo echo "#${number}: ${device}" @@ -29,7 +29,7 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { done # number=0 - for device in "${@}"; do + for device; do number=$((number + 1)) echo echo "#${number}: ${device}4" @@ -38,7 +38,7 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { done # number=0 - for device in "${@}"; do + for device; do number=$((number + 1)) echo echo "#${number}: ${device}3" @@ -51,7 +51,7 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { done # number=0 - for device in "${@}"; do + for device; do number=$((number + 1)) echo echo "#${number}: ${device}2" @@ -60,7 +60,7 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { done # members="" - for device in "${@}"; do + for device; do members="${members} ${device}2" done # LATER alternative @@ -77,7 +77,7 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { "/dev/md/boot" "/media/boot" # number=0 - for device in "${@}"; do + for device; do number=$((number + 1)) echo echo "#${number}: ${device}1" @@ -86,7 +86,7 @@ rwx_rescue_wipe_0_init_hetzner_8_8() { done # members="" - for device in "${@}"; do + for device; do members="${members} ${device}1" done # LATER alternative diff --git a/sh/self.sh b/sh/self.sh index 757b8a5..62483a5 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -9,7 +9,7 @@ # TODO move to code module rwx_self_subset() { local argument file root - for argument in "${@}"; do + for argument; do root="${rwx_main_root}/${argument}" file="${argument}.${RWX_MAIN_EXTENSION}" if [ -d "${root}" ]; then