Last active
November 9, 2023 22:59
-
-
Save nicwolff/3b585430efe07fc2ef6282725b5b34c1 to your computer and use it in GitHub Desktop.
Pipe commands in Redis format
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
#!/usr/bin/env bash | |
while read CMD; do | |
# each command begins with *{number arguments in command}\r\n | |
XS=($CMD); printf "*${#XS[@]}\r\n" | |
# for each argument, we append ${length}\r\n{argument}\r\n | |
for X in $CMD; do printf "\$${#X}\r\n$X\r\n"; done | |
done |
Author
nicwolff
commented
Nov 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment