I know you said “without third-party tools”, but sometimes a tool is just too obviously the right one, plus it’s installed on most Linux systems by default:
[madhatta@risby tmp]$ echo 12345 | rev
54321
See rev‘s man page for more.
I know you said “without third-party tools”, but sometimes a tool is just too obviously the right one, plus it’s installed on most Linux systems by default:
[madhatta@risby tmp]$ echo 12345 | rev
54321
See rev‘s man page for more.