tcsh script problem

Discussion in 'Mac Programming' started by Petros Syntelis, Jul 15, 2013.

  1. Petros Syntelis macrumors newbie

    Jul 15, 2013
    Hello guys,

    I am having a peculiar problem and i can't find out what is problem. I have this script from my linux distribution

    At the source line, the program asks for the user to type sswidlde to begin the GUI of a program called IDL.

    so, i have give the
    and when i run in terminal
    It returns
    (the printed message from the source command). But it does not begin.

    Now, if run the script line by line in the terminal, as
    The program starts!

    What is wrong with the script?
  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Exactly what is in your /usr/local/ssw/gen/setup/setup.ssw?

    I did the following:

    First, I created the necessary directory:
    mkdir -p /usr/local/ssw/gen/setup
    Next, I created a placeholder setup.ssw file:
    echo "echo From SSW: \$SSW_INSTR" >/usr/local/ssw/gen/setup/setup.ssw
    Then I confirmed it was what I expected:
    cat /usr/local/ssw/gen/setup/setup.ssw
    [I]echo From SSW: $SSW_INSTR[/I]
    I created a file in the current dir, containing exactly what you posted:
    setenv SSW /usr/local/ssw
    setenv SSW_INSTR "gen plastic impact ontology secchi eis xrt trace aia hmi chianti"
    source $SSW/gen/setup/setup.ssw
    I made it executable:
    chmod a+x
    Then I executed it (the output is in italics):
    [I]From SSW: gen plastic impact ontology secchi eis xrt trace aia hmi chianti
    sswidlde: Command not found.[/I]
    This output is exactly what I would expect, given the placeholder I used. However, it does illustrate that is not causing the problem, because the 'source' command is clearly working correctly: it runs and returns. When it returns, the 'sswidlde' is the next command, but that command doesn't exist here (since the placeholder did nothing to install it).

    Also, I don't follow the logic of telling the user to type in a 'sswidlde' command manually, when the shell script actually contains that command. It makes no sense. What are you trying to accomplish with ''? Do you really intend to run setup.ssw every time?

    Maybe I'm misunderstanding what you're trying to say. Or maybe the contents of setup.ssw needs to be looked at, so everyone understands what it should be doing.
  3. mwb macrumors newbie

    Jul 21, 2011
    It looks like SSW is expecting "sswidlde" via standard input. Does the following work?

    echo sswidlde | source $SSW/gen/setup/setup.ssw

Share This Page