Thread: Need help, please - very strange behavior

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    9

    (Solved) Need help, please - very strange behavior

    I'm stumped. I have a program that if run from clicking on the icon of the program, crashes, dies, ends, etc., at a certain point. If I run the same program from a terminal, it works perfectly.

    The program creates a file (call it filea.sh) with commands, using 'expect' and scp to contact a remote computer and copy one file to a local directory. The created file (filea.sh) is then executed using the 'system(./filea.sh)' function.

    If run from the icon, the file gets created, but it looks like it never runs or gets executed. If I run the same program from a terminal, it works perfectly. The file gets created and runs, copying the file from the remote server.

    If I run the file that was created by running the program from the icon, filea.sh, in a terminal, it runs perfectly.

    I don't believe it's anything to do with 'expect' or 'scp' as I'm using the exact same functions in another part of the program that works if run either way. I also can't believe that it's the code since it works perfectly if run from a terminal.

    One more thing to ponder. If I edit the icon and tell it run in a terminal, it works. It only fails at that point when no terminal is involved.

    Anyone have ANY ideas before I try to run it through GDB?

    Thanks
    Last edited by snork; 09-25-2011 at 07:15 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange Struct behavior
    By masilva in forum C Programming
    Replies: 5
    Last Post: 05-05-2011, 01:37 PM
  2. strange behavior of pthread_create
    By np2k in forum Linux Programming
    Replies: 13
    Last Post: 05-12-2010, 02:48 AM
  3. Strange behavior
    By onako in forum C++ Programming
    Replies: 1
    Last Post: 05-01-2010, 07:00 AM
  4. strange std::map behavior
    By manav in forum C++ Programming
    Replies: 63
    Last Post: 04-11-2008, 08:00 AM
  5. strange behavior
    By agarwaga in forum C Programming
    Replies: 1
    Last Post: 10-17-2005, 12:03 PM