Author Topic: Invoking SE from cygwin command line  (Read 5719 times)

sbusch

  • Community Member
  • Posts: 27
  • Hero Points: 0
Invoking SE from cygwin command line
« on: January 24, 2007, 03:00:41 AM »
If I'm running the cygwin bash or MKS sh as a command shell (rather than command.com) and I invoke SE for the first time ("c:/program files/spam/win/vs.exe"), control isn't given back to command line. However, if there already is an instance of SE running, then control is returned. The are workarounds to this behavior (e.g., run SE as a background task), but it would be nice if there was simpler way to do this. Running a Windows icon/shortcut won't do because I want SE to see my current environment variables.

BTW, most Windows programs have the exactly same behavior, but there are exceptions.

Thanks.

Steve

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Re: Invoking SE from cygwin command line
« Reply #1 on: January 24, 2007, 06:24:12 AM »
What could be easier than putting '&' on the end of the command line (as you've suggested)?

sbusch

  • Community Member
  • Posts: 27
  • Hero Points: 0
Re: Invoking SE from cygwin command line
« Reply #2 on: January 24, 2007, 01:08:08 PM »
I know you were going to mention that! I didn't want to have to mention it, but the MKS Toolkit shell is kinda weird when you 'exit' when there's background processes running (it hangs until you close all the background processes). This is not a biggie.

Steve

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Re: Invoking SE from cygwin command line
« Reply #3 on: January 24, 2007, 04:32:50 PM »
If you use nohup does it still hang?


nohup vs &


John Hurst
Wellington, New Zealand

sbusch

  • Community Member
  • Posts: 27
  • Hero Points: 0
Re: Invoking SE from cygwin command line
« Reply #4 on: January 24, 2007, 05:51:31 PM »
MKS Toolkit doesn't seem to have this command. However, I'm going to look over the documentation. Thanks for your help.

Steve

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Re: Invoking SE from cygwin command line
« Reply #5 on: January 24, 2007, 06:31:49 PM »
I guess you know this, but anyway ...

In UNIX if you run a background task with '&', you normally can't exit your foreground process without killing the background (child) process. If you run it with nohup, the background process can live after the foreground process dies.

BTW, are you using CygWin or MKS? I had the impression these were quite different ... is that correct?

My CygWin install includes nohup.

I tried it, but, with or without nohup, the bash window won't exit until SlickEdit exits.  I don't know why this is ... something is wrong with my understanding of nohup ... sorry about that.

John Hurst

sbusch

  • Community Member
  • Posts: 27
  • Hero Points: 0
Re: Invoking SE from cygwin command line
« Reply #6 on: January 24, 2007, 06:47:32 PM »
John,

I'm using MKS (Korn Shell) rather than cygwin. I found a workaround which lets you run a process in another window, which is not affected when you log out, so my problem is solved.

I'm embarrassed to say that didn't know about not being able to exit the foreground before the background complete. And by golly, it sure makes sense.

Steve