0

Example number:

01101000

  ->  0110 | 1000

Result:

1000 | 0110

final result :

10000110
Cyrus
  • 84,225
  • 14
  • 89
  • 153
Nicola
  • 23
  • 3
  • 1
    Does this answer your question? [Extract substring in Bash](https://stackoverflow.com/questions/428109/extract-substring-in-bash/428580#428580) – markp-fuso Aug 10 '22 at 15:57

1 Answers1

1

You can try:

a="01101000"  
echo "${a:0:4} | ${a:4:8}"

For final result:

echo "${a:4:8}${a:0:4}"

Hope it's helpful to you.

Cyrus
  • 84,225
  • 14
  • 89
  • 153
  • See: [How do I format my posts using Markdown or HTML?](https://stackoverflow.com/help/formatting). – Cyrus Aug 10 '22 at 17:57