Thanks but unfortunately it didnt work, spaces never got converted and
no errors.
$ nano.sh this-is-a-test-with-space
$ cat this-is-a-test-with-space
hello this is a few or more spaces
some more space.
You haven't understood. The script transforms only *leading* spaces
to tabs. That is: only indentation. Multiple spaces inside text are
probably meant for alignment, so it's not a good idea to change those.
If you had read the script, you could have told me that the comment
inside it is wrong. Attached is the script with a correct comment.