Find the answer to your Linux question:
Results 1 to 3 of 3
#!/bin/bash[/CODE] my_array=("Location A" "Location B") PS3="Would you like to print select locations" " select location in"my_array[at symbol]}"; do [ "${location}" !="" ] && break done echo "You have selected location: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    4

    Question Bash Question


    #!/bin/bash[/CODE]

    my_array=("Location A" "Location B")

    PS3="Would you like to print select locations" "
    select location in"my_array[at symbol]}"; do
    [ "${location}" !="" ] && break
    done
    echo "You have selected location: ${location}"


    I am having trouble getting this piece of code to work. I keep receiving an - unexpected E0F while looking for matching `"' error and syntax error: unexpected end of file

    Help would be very much appreciated. Thank you in advance.

  2. #2
    Just Joined!
    Join Date
    Oct 2010
    Posts
    4
    As a reminder - I cannot print the 'at symbol' because I have not yet posted 15 posts and since the forum thinks I am posting an url, such a symbol will not display.

  3. #3
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    Just a wild guess. It has something to do with the quotes.One of your quotes doesn't have a matching opening/closing quote?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •