異なる時間に複数の信号を送信するタイムアウトを使用してプログラムを実行する

異なる時間に複数の信号を送信するタイムアウトを使用してプログラムを実行する

複数の時間制限とさまざまな制限信号を使用してタイムアウトプログラムを実行する必要があります。

たとえば、

nanoを実行し、タイムアウト後5秒後にSIGTERMを送信し、10秒後にSIGKILLを送信します。

ベストアンサー1

"sleep"プログラムはcoreutilsパッケージの一部です。

コンソールで次のコマンドを実行します。

man sleep

プログラムのマニュアルページを見つけることができます。

NAME
       sleep - delay for a specified amount of time

SYNOPSIS
       sleep NUMBER[SUFFIX]...
       sleep OPTION

DESCRIPTION
       Pause  for  NUMBER  seconds.   SUFFIX may be 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days.  Unlike most implementations that require NUMBER be an integer, here
       NUMBER may be an arbitrary floating point number.  Given two or more arguments, pause for the amount of time specified by the sum of their values.

       --help display this help and exit

       --version
              output version information and exit

AUTHOR
       Written by Jim Meyering and Paul Eggert.

おすすめ記事