Skip to content

Instantly share code, notes, and snippets.

@merin83
Created October 30, 2017 09:43
Show Gist options
  • Select an option

  • Save merin83/2107ee23060f5fdddaee4ec551dcf1a2 to your computer and use it in GitHub Desktop.

Select an option

Save merin83/2107ee23060f5fdddaee4ec551dcf1a2 to your computer and use it in GitHub Desktop.
nth position string in bash ( the long way )
read n
text=""
for ((i=0; i<n; i++))
do
temp=""
read input
temp=${input:2:1}
text=$text$temp
done
for ((i=0; i<n; i++))
do
echo ${text:$i:1}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment