Jump to content




How to run programs in the background?


  • You cannot reply to this topic
7 replies to this topic

#1 houseofkraft

  • Members
  • 170 posts
  • LocationUSA

Posted 21 September 2016 - 11:15 AM

Hi Guys!

I want to run a program in the background. If i use the bg command then it will run in the background but it will have a tab. I want to run a program in the background without that tab showing up. It would be very useful for different things. Like for my WIP Alarm System i can make it so on my CC PC it will notify me when an intruder enters.

Thanks!

#2 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 21 September 2016 - 12:07 PM

The easiest way to handle this is to just accept the tabs. They won't kill you.

Otherwise you could run a TLCO (Top Level Coroutine Override) and add your alarm to the coroutine "stack", next to multishell and rednet.run.

#3 Lupus590

  • Members
  • 2,028 posts
  • LocationUK

Posted 21 September 2016 - 01:33 PM

or you could have your program create a shell instance under it. like vncd does.

#4 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 21 September 2016 - 07:35 PM

View PostH4X0RZ, on 21 September 2016 - 12:07 PM, said:

The easiest way to handle this is to just accept the tabs. They won't kill you.

Otherwise you could run a TLCO (Top Level Coroutine Override) and add your alarm to the coroutine "stack", next to multishell and rednet.run.

Note that TLCO won't work in Lua 5.2.

#5 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 21 September 2016 - 07:49 PM

View PostSewbacca, on 21 September 2016 - 07:35 PM, said:

View PostH4X0RZ, on 21 September 2016 - 12:07 PM, said:

The easiest way to handle this is to just accept the tabs. They won't kill you.

Otherwise you could run a TLCO (Top Level Coroutine Override) and add your alarm to the coroutine "stack", next to multishell and rednet.run.

Note that TLCO won't work in Lua 5.2.

Why?

#6 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 21 September 2016 - 07:52 PM

View PostH4X0RZ, on 21 September 2016 - 07:49 PM, said:

View PostSewbacca, on 21 September 2016 - 07:35 PM, said:

View PostH4X0RZ, on 21 September 2016 - 12:07 PM, said:

The easiest way to handle this is to just accept the tabs. They won't kill you.

Otherwise you could run a TLCO (Top Level Coroutine Override) and add your alarm to the coroutine "stack", next to multishell and rednet.run.

Note that TLCO won't work in Lua 5.2.

Why?

TLCO is based on setfenv and getfenv, functions that will be removed in Lua 5.2, so it will be impossible to hack that, except bios would provide a setting to enable running startup on top.

Edited by Sewbacca, 21 September 2016 - 07:52 PM.


#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 21 September 2016 - 08:58 PM

This simply isn't true. It is not helpful to spread misinformation.

#8 Sewbacca

  • Members
  • 450 posts
  • LocationStar Wars

Posted 21 September 2016 - 09:26 PM

Sorry, i thought i edited my post after a few minutes, but it seems that it didn't worked:

Quote

EDIT:
See posts #4 - #6.

Also, i couldn't know, that it is possible without getfenv and setfenv. I just don't saw any other possibility.

Sewbacca

Edited by Sewbacca, 21 September 2016 - 09:33 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users