Skip to content

Commit e706c03

Browse files
committed
[feat]: responding to a SIGTERM signal with an echo statement
1 parent 51ba04f commit e706c03

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Diff for: 0x05-processes_and_signals/67-stop_me_if_you_can

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
# script that stops 4-to_infinity_and_beyond process without kill or killall
3+
pkill -f 7-highlander

Diff for: 0x05-processes_and_signals/7-highlander

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
# To infinity and beyond indefinitely
3+
# with a sleep 2 in between each iteration
4+
# I am invincible!!! when receiving a SIGTERM signal
5+
while true
6+
do
7+
echo "To infinity and beyond"
8+
sleep 2
9+
trap 'echo "I am invincible!!!"' SIGTERM
10+
done

0 commit comments

Comments
 (0)