External tools

معکوس‌کردن رشته
معکوس‌کردن رشته در مسیر Bash

The GNU Linux core utilities contain lots of goodies. To reverse strings, use rev.

$ echo "Hello, World!" | rev
!dlroW ,olleH

rev also works with files to reverse each line.

$ printf '%s\n' one two three > myfile
$ rev myfile
eno
owt
eerht

There are other ways to do this, but none are a simple as rev.

grep -o . <<< "$string" | tac | paste -s -d ''
perl -lne 'print scalar reverse' <<< "$string"
# etc
30 سپتامبر 2026 · برایتان مفید بود؟

رویکردهای دیگر برای تمرین معکوس‌کردن رشته در مسیر Bash

روش‌های دیگری که جامعه‌ی ما این تمرین را با آن‌ها حل کرده است