How do you stop a shell process?
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    osco
    Posts: 680 from 2009/10/21
    From: Boston, USA
    Sometimes a process hangs in a shell window...How do you stop it and close the window? The DOS command "BREAK" needs a cursor? What if there isn't one in the window?

    :-?
    Ctrl+C is the default for sending a Break signal to halt a process.
    A process that has been aborted this way displays ***Break
    in the Shell window. Ctrl+D halts execution of a script file.

    Just found it in the manual :-D :-D :-D :-D

    [ Edited by osco on 2010/1/20 11:11 ]
    Mac Mini 1.5GHz, 1G, 250G Drive, Apple Cinema Display, MorphOS 3.1 registered, MacOS 10 PowerBook (5,8) 1.67Hz, 2G, 80G Drive,........Waiting
    PowerBook (5,8) 1.67Hz, 2G, 40G MorphOS 3.1 unregisterd
  • »20.01.10 - 15:06
    Profile
  • Moderator
    Golem
    Posts: 766 from 2003/2/28
    From: Denmark
    Press ctrl-c, next time maybe you could check the manual before starting another thread? Maybe post your findings to your blog?
  • »20.01.10 - 15:11
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Ruud
    Posts: 335 from 2009/2/2
    From: Hampshire, UK
    @Golem

    Didn't you know?
    MorphZone IS osco's blog ;-)

    [ Edited by Ruud on 2010/1/20 16:25 ]
    "We live, we die, we laugh, we cry"
  • »20.01.10 - 15:25
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    mihailod
    Posts: 170 from 2010/1/8
    Wait, I thought it was my blog!?!? :-D

    Seriously, I don't think there is harm in having simple questions and answers here. People Google their problems more often than looking into manual and stuff on this forum will be shown in the Google results.

    Is the MorphOS manual visible to Google? If not it should be so it can be indexed.

    This gives a mixed results at best:
    http://www.google.com/search?q=morphos+break+shell+process

    This is much better but you have to know to about Amiga:
    http://www.google.com/search?q=amiga+break+shell+process
  • »20.01.10 - 17:52
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    osco
    Posts: 680 from 2009/10/21
    From: Boston, USA
    What's a blog? Ok Golem googling "blog" hmmmm SAID well! @Ruud and Golem. In a way MorphZONe is my Blog..
    It is interesting to me my progress or lack of it with MorphOS.. I can't tell you how happy I am with Morph. My Home Page is MorphZone. My posts (blog) show some sucsess :) I read most of the posts.
    Thank-you again :-D :-D :-D :-D
    Mac Mini 1.5GHz, 1G, 250G Drive, Apple Cinema Display, MorphOS 3.1 registered, MacOS 10 PowerBook (5,8) 1.67Hz, 2G, 80G Drive,........Waiting
    PowerBook (5,8) 1.67Hz, 2G, 40G MorphOS 3.1 unregisterd
  • »20.01.10 - 18:27
    Profile
  • Cocoon
    Cocoon
    Beamish2040
    Posts: 44 from 2009/4/2
    Quote:


    Golem wrote:
    Press ctrl-c, next time maybe you could check the manual before starting another thread? Maybe post your findings to your blog?

    There's a manual?
  • »20.01.10 - 21:59
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    mihailod
    Posts: 170 from 2010/1/8
    I think he was referring to the Amiga DOS manual.
  • »20.01.10 - 22:16
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    osco
    Posts: 680 from 2009/10/21
    From: Boston, USA
    by Beamish2040 on 2010/1/20 17:59:59
    There's a manual?

    Help.lha
    Inline manual for MorphOS Shell Commands
    Mac Mini 1.5GHz, 1G, 250G Drive, Apple Cinema Display, MorphOS 3.1 registered, MacOS 10 PowerBook (5,8) 1.67Hz, 2G, 80G Drive,........Waiting
    PowerBook (5,8) 1.67Hz, 2G, 40G MorphOS 3.1 unregisterd
  • »20.01.10 - 22:36
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jcmarcos
    Posts: 1178 from 2003/3/13
    From: Pinto, Madrid ...
    Yes, Control-C sends a break signal to the process. Also, Control-D sends another different break signal, and you can send those signals from another console (knowing its process number) with the "break" command.
    But it's all a matter if the process actually LISTENS to those signals. One can write a program that locks itself deaf while doing something, not listening to anyone. Precisely, not listening to anyone is typical of crashed programs. Then, you should use a task manager to, hopefully, terminate the process (ugh!) and, more hopfully, attempt to recover the resources it was using.
  • »21.01.10 - 07:46
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    osco
    Posts: 680 from 2009/10/21
    From: Boston, USA
    "actually LISTENS to those signals. One can write a program that locks itself deaf while doing something, not listening to anyone. Precisely, not listening to anyone is typical of crashed programs."

    sounds like my wife :-D
    Mac Mini 1.5GHz, 1G, 250G Drive, Apple Cinema Display, MorphOS 3.1 registered, MacOS 10 PowerBook (5,8) 1.67Hz, 2G, 80G Drive,........Waiting
    PowerBook (5,8) 1.67Hz, 2G, 40G MorphOS 3.1 unregisterd
  • »21.01.10 - 09:21
    Profile
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    OWB cut this post, and pushing back was a bad idea :)


    [ Edited by geit on 2010/1/21 11:30 ]
  • »21.01.10 - 09:28
    Profile
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    Open a new shell:

    Type "status"

    result is something like this:

    Process 1: Loaded as command: sushi
    Process 3: Loaded as command: status
    Process 4: Loaded as command: SuperApp

    SuperApp is the program we want to kill. Process number is 4 so type:

    Break 4

    Another status call will show you if the command reacted.

    Geit



    [ Edited by geit on 2010/1/21 11:30 ]
  • »21.01.10 - 09:29
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    _ThEcRoW
    Posts: 298 from 2008/10/27
    I encountered sometimes with programs that keep the shell window open. Pressing ctrl+c shows break, but i can't close the window, it keeps iconified.
    Tried with the task manager, but no luck. Are these processes un-exitable until you reboot?.
    Also another question a bit off topic: When a program crash(under os4emu), what's the way to get again into morphos workbench instead or rebooting?.
    Mac Mini G4 1,4ghz 1gb ram & MorphOS 3.11
  • »21.01.10 - 13:29
    Profile
  • Moderator
    Golem
    Posts: 766 from 2003/2/28
    From: Denmark
    Quote:


    _ThEcRoW wrote:
    I encountered sometimes with programs that keep the shell window open. Pressing ctrl+c shows break, but i can't close the window, it keeps iconified.
    Tried with the task manager, but no luck. Are these processes un-exitable until you reboot?

    You need to make sure parent task has quit, then it should be possible to close the shell window. To avoid having an iconified shell window on your ambient desktop you can just hide the window with ctrl-lalt-i (see icontrol prefs).
  • »21.01.10 - 13:47
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    You can also use TaskManager or scout to break a task/process, they are more comfortable, since they have a gui!
  • »21.01.10 - 15:55
    Profile Visit Website
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2096 from 2003/2/24
    From: po-RNO
    ...and if we want to play around with status and break bit more :)

    If you want to break certain named process automatically from a script, you could do for example this:

    Status COM SuperApp > T:SuperApp.pid
    Break ? < T:SuperApp.pid >NIL:

    I use it to unmount smbfs shares from dopus menus/hotkeys :)

    And if you want to get more complete list of tasks in shell, you can use TaskList command. And make more brutal kills with iKill command.
  • »21.01.10 - 16:54
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    mihailod
    Posts: 170 from 2010/1/8
    Got this via emai from C.S.:

    "If you wish to "kill" a shell, use the command "mossys:c/iKill".
    Simple double click this program. After that the cursor was changed to a
    cross.
    If you now klick with this "cross" a shell - window, the Thread was
    finished."
  • »21.01.10 - 20:54
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12150 from 2003/5/22
    From: Germany
    > When a program crash(under os4emu), what's the way to get again into
    > morphos workbench instead or rebooting?.

    I guess it's the same as with any program: Just switch screen.
  • »22.01.10 - 04:48
    Profile
  • pOS
  • Order of the Butterfly
    Order of the Butterfly
    pOS
    Posts: 217 from 2003/11/14
    From: Bavaria
    Code:
    Status COM SuperApp > T:SuperApp.pid
    Break ? < T:SuperApp.pid >NIL:


    You could also write it that way:

    Quote:

    Break >NIL: `Status COM SuperApp`


    Note the Backticks ! ` `

    The output of the command between is used as input for the break command. Kind of simple PIPE functionallity, introduced with AmigaOS 2.0.
  • »22.01.10 - 07:36
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Tcheko
    Posts: 534 from 2003/2/25
    From: France
    IIRC, there is the freeze command. Open taskmanager, get the process ID and type

    freeze processidnumber

    in a shell. It will freeze the task/process. It doesn't remove intuition stuff like iKill nor free any ressources afaik.
    Quelque soit le chemin que tu prendras dans la vie, sache que tu auras des ampoules aux pieds.
    -------
    I need to practice my Kung Fu.
  • »22.01.10 - 12:51
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    _ThEcRoW
    Posts: 298 from 2008/10/27
    MorphOS should let me change screen?. I mean when a os4 program crashes and all is showed is a black screen.

    P.D: What are the keyboard shortcuts for window switching?

    [ Edited by _ThEcRoW on 2010/1/22 14:20 ]
    Mac Mini G4 1,4ghz 1gb ram & MorphOS 3.11
  • »22.01.10 - 13:12
    Profile
  • Moderator
    Golem
    Posts: 766 from 2003/2/28
    From: Denmark
    Quote:


    _ThEcRoW wrote:
    MorphOS should let me change screen?. I mean when a os4 program crashes and all is showed is a black screen.

    Depending on the state of the system lcommand-m/n should work for that.
    Quote:

    What are the keyboard shortcuts for window switching?

    None are defined by default, but have a look in Prefs -> IControl.
  • »22.01.10 - 13:46
    Profile Visit Website