Find the answer to your Linux question:
Results 1 to 4 of 4
I was attempting to write a korn shell script that would prompt a user with various questions and build the arguments for a 'make' command. I ran into a problem, ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    2

    [SOLVED] korn shell and quoted arguments

    I was attempting to write a korn shell script that would prompt a user with various questions and build the arguments for a 'make' command. I ran into a problem, however. The quoted arguments are being interpreted as if they had no quotes.

    Currently in my script I have the following source at the end:

    echo parms=${parms}
    make -f sample.mk ${parms}


    I run the program and the output looks like this:

    parms=all C_FLAGS="-DDEV -DDEBUG"
    make: Fatal error: Unkown option `-G'


    If I type the following at the command line...

    make -f sample.mk all C_FLAGS="-DDEV -DDEBUG"

    ...it works fine. If I remove the quotes, I get the same error as the script. So I'm 99% sure that the quotes are being lost/ignored.

    Well, I hope I've described the problem clearly. Any ideas how to overcome this little hurdle?

    Thanks in advance,
    Darren

  2. #2
    Linux Newbie
    Join Date
    Mar 2009
    Posts
    228
    Just a guess, but add a 'eval' in front of the 'make' commad.

    Code:
    eval make -f sample.mk ${parms}

  3. #3
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    718
    Another guess would be that
    Code:
    echo parms=${parms}
    just does not what you expect from it.

    Why would make complain about "Unknown option`-G'" if there is no -G option?

  4. #4
    Just Joined!
    Join Date
    Aug 2010
    Posts
    2
    Quote Originally Posted by lomcevak View Post
    Just a guess, but add a 'eval' in front of the 'make' commad.

    Code:
    eval make -f sample.mk ${parms}
    That worked. Thank you much. Where's the kudos button?

    Darren

Posting Permissions

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