Skip to content

Commit 9182239

Browse files
committed
Added Bash snippet to print the items of an array on multiple lines
1 parent 71b190f commit 9182239

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

snippets/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ Some pieces of code I find useful for some reason.
113113
- `arr=(one two 'three four'); escaped_items=("${arr[@]@Q}"); echo "${escaped_items[0]}"; escaped_str="${arr[*]@Q}"; echo "$escaped_str"`
114114
- `bash -ec 'echo "${0@Q} - ${*@Q}"' bash hey 'hello world'`
115115
- `mapfile -t arr < <(echo 'hey "hello world"' | xargs -n1)`
116+
- `printf '%s\n' "${arr[@]}"`
116117
- `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`
117118
- `modprobe -r mymod01 mymod02`, `echo -e 'blacklist mymod01\nblacklist mymod02' > /etc/modprobe.d/blacklist-mymod.conf`
118119
- `bind -x '"\e": mycommand'`

0 commit comments

Comments
 (0)