The script bellow is asking the user to enter something then it print the entry as an output:#!/bin/bash printf \e[31mType/Enter something: $pdir\e[m  ; read -e userInput if [[ -n $userInput ]] then     pdir=$userInput  fi printf \e[96mYour code is: $pdir\e[m\n;My questions are:How can the previous code read only letters in userInput?  How can I convert my entry userInput as an output numbers for example if I enter John how can I get an output numbers. 
Code letters as numbers
bash
Here are 2 ways that come to mindconvert each character to its ASCII value$ echo John | perl -lne 'printf %03d, ord for split '074111104110Or, if you don't strictly need numbers, just a code, base64$ echo John | base64Sm9obgo=To decode:$ echo 074111104110 | perl -ne 'print chr for /(\d{3})/g'John$ echo Sm9obgo= | base64 --decodeJohn