Created
July 5, 2025 17:13
-
-
Save jdimpson/8078fbc60a93a08573fb285edbaa342e to your computer and use it in GitHub Desktop.
inspect and modify command line parameters in a bash wrapper script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
c=0; | |
args=( "$@" ); | |
while test $c -lt ${#args[@]}; do | |
# inspect "${args[$c]}" | |
# assign to args[$c] | |
c=$(expr $c + 1); | |
done | |
set -- "${args[@]}"; | |
# if you want to add new args: | |
# set -- "-u" "user" "-p" "pass" "${args[@]}"; | |
# run original command with $*, e.g. | |
# exec yt-dlp "$*"; | |
# and invoke this script with command line | |
# flags as if it were the original command. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment