Skip to main content
3 of 3
edited tags
jesse_b
  • 41.6k
  • 14
  • 109
  • 163

How to split a string in two substrings of same length using bash?

I would like to split a string into two halves and print them sequentially. For example:

abcdef 

into

abc def 

Is there a simple way to do it, or it needs some string processing?

Gabriel Diego
  • 273
  • 1
  • 3
  • 8