I'm trying to make this simple script:
#!/bin/sh
echo -en "What is your name [ `whoami` ] "
read myname
if [ -z "$myname" ]; then
myname=`whoami`
fi
echo "Your name is: $myname"
What I want: to read my input in the same line as What is your name message is.
What I get( PROBLEM ): the console reading the input on a new line and taking the option -en
as another string.
What I have tried: Change #!/bin/sh
to #!/bin/bash
and using only e
as an option.
Why is this not working? Thank you for your time.