Tag: string
Bash | split a string into an array
ARRAY=(${STRING//,/ }) Dont forget the space character after the last slash.
Decode URL encoded strings on OpenBSD
alias urldecode=’$PYTHON -c “import urllib, sys; print urllib.unquote(sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()[0:-1])”‘
Bash | compare two arrays | compare two strings
comm -12 <(printf ‘%s\n’ “${ARRAY1[@]}” | LC_ALL=C sort) <(printf ‘%s\n’ “${ARRAY2[@]}” | LC_ALL=C sort) comm -12 <(printf ‘%s\n’ ${STRING1} | LC_ALL=C sort) <(printf ‘%s\n’ ${STRING2} | LC_ALL=C sort)
Liquidsoap | concat strings
c_host=”127.0.0.1″ c_port=80 url=”http://#{c_host}#{c_port}/mymount.mp3″