Last active
March 18, 2026 12:41
-
-
Save konsolebox/71c7daed50a1d56da9252bfc9da9f3b3 to your computer and use it in GitHub Desktop.
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
| function get_command_string { | |
| local string= q | |
| for __; do | |
| printf -v q %q "$__" | |
| if [[ $q == "$__" ]]; then | |
| string+=" $__" | |
| elif [[ $__ == *\'* ]]; then | |
| string+=" $q" | |
| else | |
| string+=" '$__'" | |
| fi | |
| done | |
| __=${string# } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment