Linux command or Bash syntax that calculate the next ASCII character

awk, bash, linux, perl

Solution

Perl's `++` operator also handles strings, to an extent:

perl -nle 'print ++$_'

The `-l` option with autochomp is necessary here, since `a\n` for example will otherwise return `1`.

Problem

I have a Linux machine (Red Hat Linux 5.1), and I need to add the following task to my Bash script. Which Linux command or Bash syntax will calculate the next ASCII character? Remark – the command syntax can be also AWK/Perl, but this syntax must be in my Bash script. Example: ``` input results a --> the next is b c --> the next is d A --> the next is B ```

Original source