Skip to main content
2 of 3
edited title
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 267

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