I want to launch Oobabooga Textgen WebUI from the command line with its serial output. I also want to run a while loop that retrieves the Nvidia GPU memory available and temperature for display on the header bar with a 5 second sleep delay. How do I run both of those at the same time?

  • experbia@lemmy.world
    link
    fedilink
    arrow-up
    19
    ·
    8 months ago

    as already mentioned, ampersand allows you to “background” a task. but if you’d like the output from your program alongside the loop monitoring system info, consider using a terminal multiplexer like tmux.

    on the terminal, this will let you open a “split screen” pane with another shell. you can use hotkeys to create, destroy, or move between views.

  • ik5pvx@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    8 months ago

    Is there a particular reason you can’t just open 2 xterm and run each command in its own ?

  • future_turtle@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    ·
    8 months ago

    You probably want to make a launcher script. An easy start would be to background your main process and route the output wherever you want. Run your monitor loop and send the output wherever you want. Then you can examine and kill the main background pid on script exit. The simplest way in bash might be something like kill $(jobs -p)

    This can get a bit more complicated if you want it all to exit if anything fails or something like that. Read up on pkill, disown, kill, $$, trap…tons of possibilities

    Some of these things aren’t very portable though, so do check if you decide to switch shells….or do what the rest of us do and scratch your head for an hour before cussing ourselves for not being posix compliant, swear we will next time, then don’t