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
2026년 09월 23일 · 유용했나요?

Bash의 문자열 뒤집기에 대한 다른 접근법

우리 커뮤니티가 이 연습 문제를 해결한 다른 방법