Skip to content

Instantly share code, notes, and snippets.

@roblogic
Created September 25, 2019 05:38
Show Gist options
  • Select an option

  • Save roblogic/59b714eea1f170da04eabb2766ef5056 to your computer and use it in GitHub Desktop.

Select an option

Save roblogic/59b714eea1f170da04eabb2766ef5056 to your computer and use it in GitHub Desktop.
while read w; do
i=
for ((n=1;i++<#w;n++))[[ $w[i] != $w[i+1] ]]&&printf $n$w[i]&&n=0
echo
done < <(echo "heeeello\nwoooorld")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment