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.
More Related Contents:
- Echo newline in Bash prints literal \n
- In the shell, what does ” 2>&1 ” mean?
- What is the difference between $(command) and `command` in shell programming?
- ssh breaks out of while-loop in bash [duplicate]
- Remove a fixed prefix/suffix from a string in Bash
- I just assigned a variable, but echo $variable shows something else
- Change the current directory from a Bash script
- Bash how do you capture stderr to a variable? [duplicate]
- How to use aliases defined in .bashrc in other scripts?
- Variable containing multiple args with quotes in Bash
- Should aliases go in .bashrc or .bash_profile? [duplicate]
- How to read user input into a variable in Bash?
- How to provide password to a command that prompts for one in bash?
- Deleting lines from one file which are in another file
- source command not found in sh shell
- How to check if a file contains a specific string using Bash
- VSCode Change Default Terminal
- How to enter ssh password using bash? [duplicate]
- What is a unix command for deleting the first N characters of a line?
- How do I escape slashes and double and single quotes in sed?
- How can I get a recursive full-path listing, one line per file?
- How to suppress variable substitution in bash heredocs
- Error message on Terminal launch [duplicate]
- Exit when one process in pipe fails
- How to split a file into equal parts, without breaking individual lines? [duplicate]
- Jenkins pipeline sh fail with “cannot run program nohup” on windows
- Translating OS X Bash Script for Windows
- Read n lines at a time using Bash
- Missing Carriage Return in Docker for Mac Containers
- How do I kill a backgrounded/detached ssh session?