To read input from stdin to a variable, namely inp. Use read command

read -r inp

-r flag is not a mandatory flag but is recommended in most cases.

From official read manual by typing help read from command line

-r do not allow backslashes to escape any characters

Refer to shell check SC2162 rule


Example

read my_var
#enter: hello\ world
echo "${my_var}"
#print: hello world

read -r my_var
#enter: hello\ world
echo "${my_var}"
#print: hello\ world

Bonus

To read space delimited list of words and assign to an indexed array, add -a flag

read -r -a my_list #-a must follow after -r
#enter: hello\ world
echo "${#my_list[@]}" # print number of elements
#print: 2

read -a my_list
#enter: hello\ world
echo "${#my_list[@]}"
#print: 1

To read multiple lines and assign each line to an element of an array, use mapfile -t ( -t flag is recommended to remove trailing newline character)

mapfile -t my_list
#enter
#hi
#new world
#ctrl-D
echo ${#my_list[@]}
#print 2
echo ${#my_list[0]}
#print 2

mapfile my_list
#enter
#hi
#new world
#ctrl-D
echo ${#my_list[0]}
#print 3

To redirect the standard input from an variable use <<< pipeline ( here strings)

mapfile -t my_list <<< "${my_var}"

Check my article about array variables in bash.