Skip to content

Commit

Permalink
Improved Bash escape array snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotte committed Jan 3, 2025
1 parent 343000a commit f659184
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snippets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Some pieces of code I find useful for some reason.
- `venv/bin/python3 -mpip install -U --progress-bar=off -r requirements.txt`
- `escape_if_any() { echo "${1:+${1@Q}}"; }`
- `json_min_escape() { cat | jq -c . | jq -Rrs 'rtrimstr("\n") | @json'; }`
- `arr=(one two three); echo "${arr[@]@Q}"; echo "${arr[*]@Q}"`
- `arr=(one two 'three four'); escaped_items=("${arr[@]@Q}"); echo "${escaped_items[0]}"; escaped_str="${arr[*]@Q}"; echo "$escaped_str"`
- `bash -ec 'echo "${0@Q} - ${*@Q}"' bash hey 'hello world'`
- `vlc -vvv -Idummy --no-audio screen:// --screen-fps=10 --sout='#transcode{vcodec=MJPG,scale=0.5}:standard{access=http,mux=mpjpeg,dst=:8080/}' --sout-http-mime='multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a' --live-caching=100`
- `modprobe -r mymod01 mymod02`, `echo -e 'blacklist mymod01\nblacklist mymod02' > /etc/modprobe.d/blacklist-mymod.conf`
Expand Down

0 comments on commit f659184

Please sign in to comment.