input
> a='Vikas'
> echo $a
Vikas
my required output is
echo $a | <some command>
vIKAS
input
> a='Vikas'
> echo $a
Vikas
my required output is
echo $a | <some command>
vIKAS
$ echo Vikas | LC_ALL=C tr a-zA-Z A-Za-z
vIKAS
The utility tr translates characters; it takes two arguments representing sets of characters; it then copies standard input to standard output replacing each character found in the first set with the corresponding character in the second set. In this application, it replaces lowercase letters with uppercase letters and vice-versa. See the manual page of tr(1) for details and for other processing which tr can perform.
you can use tr command with [:upper:] and [:lower:] options, like this:
echo "aBcDeF" |tr '[:upper:][:lower:]' '[:lower:][:upper:]'
AbCdEf
also you can use sed command (stands for 'Stream editor'), like this:
echo "abcd ABCD" |sed 'y/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/'
sed has more flexibility, it means you can define any character mapping. for example you can convert numbers to hackers letter with this command:
echo "52065218802365" |sed 'y/0123456789/OIZEhSGLBP/'
SZOGSZIBBOZEGS