Here are two more ways:
Please keep in mind that space is very important in Bash. So, if you want your command to run, use as is without introducing any more spaces.
The following assigns harshil
to L
and then prints it
L=$"harshil"
echo "$L"
The following assigns the output of the command tr
to L2. tr
is being operated on another variable, L1.
L2=$(echo "$L1" | tr [:upper:] [:lower:])