Results 1 to 10 of 10

Thread: Simple script problem - Help!

  1. #1
    Join Date
    Sep 2008
    Location
    Chicago
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Simple script problem - Help!

    I wrote and made the following script executable (chmod +x MyScript.sh):

    echo Starting script to launch prog-name.
    cd "/home/MyUserName/.wine/drive_c/Program Files (x86)/Prog-Name"
    wine prog-name.exe

    When I point a terminal at the subdirectory containing the script I type:
    ./MyScript.sh

    And Ubuntu answers:
    Starting script to launch prog-name
    .
    ./MyScript.sh: line 2: cd: /home/MyUserName/.wine/drive_c/Program Files
    : No such file or directory

    Changing the double quotes on line 2 to single ones has no effect. If I put the entirety of line 2 between single quotes, Ubuntu answers:
    ./MyScript.sh: line 2: cd: /home/MyUserName/.wine/drive_c/Program Files (

    I don't see this as being a Wine issue. What the devil is going on? Kudos for any and all help.

  2. #2
    Join Date
    Feb 2008
    Beans
    Hidden!

    Re: Simple script problem - Help!

    n/m. stated he tried quotes.


  3. #3
    Join Date
    Sep 2008
    Location
    Chicago
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Simple script problem - Help!

    The mystery deepens. When I escape the spaces (keeping quotes), Ubuntu responds with another letter of the command:
    ./MyScript.sh: line 2: cd: /home/MyUserName/.wine/drive_c/Program Files (x

    I am using Ubuntu 13.04 and Gnome 3.6.3, by the by. I have 32 GB of RAM. I also use Gnome without special effects. Can some guru help me, double pretty please?

  4. #4
    Join Date
    Sep 2008
    Location
    Chicago
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Simple script problem - Help!

    Deeper still. If I simply escape the spaces and get rid of both single quotes, Ubuntu complains about a syntax error near unexpected token '('.

  5. #5
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,625
    Distro
    Ubuntu Development Release

    Re: Simple script problem - Help!

    Hi

    Open a terminal and type

    Code:
    cat -A <file_name>
    Capital A above and change the filename to the name of your script.

    Post the output back here between code tags like this

    [code]output[/code]

    to get output like this.

    Code:
    output
    KInd regards
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

  6. #6
    Join Date
    Jul 2005
    Location
    England
    Beans
    Hidden!

    Re: Simple script problem - Help!

    Where and why did the round bracket come from?

    Does the wine prog-name.exe command in your script work if you run it directly in terminal from the correct ~/.wine subfolder?
    DISTRO: Xubuntu 12.04-64bit --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo

  7. #7
    Join Date
    May 2009
    Location
    Courtenay, BC, Canada
    Beans
    1,661

    Re: Simple script problem - Help!

    you need to escape () as well, however, why it doesn't work with quotes/ticks is a mystery to me
    what's the output of
    Code:
    find $HOME/.wine/ -type d
    Last edited by HiImTye; June 17th, 2013 at 09:03 PM.

  8. #8
    Join Date
    Sep 2008
    Location
    Chicago
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Simple script problem - Help!

    [snip]
    Last edited by whitesmith; June 17th, 2013 at 10:44 PM. Reason: sednt wrong info

  9. #9
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,625
    Distro
    Ubuntu Development Release

    Re: Simple script problem - Help!

    Hi

    I think you slightly misunderstood me; my fault as i did not explain myself very well.

    I have hoping to see the output of...

    Code:
    cat -A Merriam-Webster-Unabridged.sh
    I'm looking for any characters that should not be there in the script.

    Can you post the output of that command above please.

    Kind regards
    Join us on irc at #ubuntuforums. For web chat see here

    If you believe everything you read, you better not read. ~ Japanese Proverb

    Do not read newspapers on an empty stomach ~ Russian Proverb ~ BrunoLotse

  10. #10
    Join Date
    Sep 2008
    Location
    Chicago
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Simple script problem - Help!

    Quote Originally Posted by ajgreeny View Post
    Where and why did the round bracket come from?

    Does the wine prog-name.exe command in your script work if you run it directly in terminal from the correct ~/.wine subfolder?
    Yes! I forgot to escape the parens. I used Main Menu to credate the DT launcher I wanted. Many thanks to all who contributed ideas.
    Last edited by whitesmith; June 17th, 2013 at 10:46 PM.

Bookmarks

Posting Permissions

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