Problems executing script

Hi, I'm a complete novice to Linux and UNIX. I'm having trouble getting a script to execute properly. I did a similar script earlier in the semester with no problems. For whatever reason I can't get this one to work. Any help would be greatly appreciated as I'm completely lost and frustrated at this point!I apologize in advance if I don't use proper terms, I'm not familiar with all the technical jargon yet!

I created a script using vi, named filepro
This is the format we need to use:

#!/bin/ksh 
cat <<++ 
 
MAIN MENU 
1) Print current working directory 
2) Delete file in current directory 
3) Rename file in current directory 
++ 
 
echo Please enter your selection $LOGNAME:

I made it executable with:

Chmod 755 filepro
./filepro

Everything appears to be to be correct
When I type in filepro I get:

MAIN MENU 
1) Print current working directory 
2) Delete file in current directory 
3) Rename file in current directory 
Please enter your selection LNOWE:

No matter what I select 1-3
I get an error message:

1: not found 2: not found etc...

I�ve tried adding and removing spaces in the main menu. I tried #!bin/bash, #!bin/sh. Adding and removing space between cat <<.
This is obviously a simple straight forward script. But I can�t seem to get it right. Please help. Thanks!:confused:

Lewis and Clark Community College, Godfrey, IL, US
Prof Rick Burgess, CNET 200 Intro to UNIX and Linux.

Hi, where is the part where you read the answer and what do you need to do with the answer? Could you please format you post so that it adheres to the standard formatting for homework posts?

  1. Please enter your selection LNOWE:

In your code, put $LOGNAME in SINGLE QUOTES ''
'$LOGNAME' or try prefixing a \to $ \$LOGNAME
your current script is interpolating the value of $LOGNAME defined as an environment variable

  1. No matter what I select 1-3
    I get an error message

What are you doing with the input recieved from user? you are not reading it hence getting error.

Also, as far as I know there should be no unwanted spaces in a here document so try removing any unwanted white spaces betwee the ++ block

Your code never asks for input. Your program FINISHES by the time you're typing anything in. You need to use the read command to read input after you show the menu. read VARNAME

Thanks, as soon as I read that I realized what I did. Still trying to figure all of this out.
Thanks again

Hi ,

I think the problem is that ,you haven't specified where should the menu get the data from i;e inputs ,you should provide all the details like where the input comes from and where u want to display data....