Skip to content

Commit fa4b836

Browse files
committed
tasks
1 parent ef1e0c7 commit fa4b836

9 files changed

+55
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Displays a list of currently running processes containing the bash keyword.
3+
# shellcheck disable=SC2009
4+
5+
ps -aux | grep bash
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Displays the PID along with the process name, of
3+
#+ processes whose name contains the word "bash".
4+
5+
pgrep bash -l
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# Displays "To infinity and beyond" indefinitely with
3+
#+ a sleep 2 in between each iteration.
4+
5+
while true
6+
do
7+
echo "To infinity and beyond"
8+
sleep 2
9+
done
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
# Kills the 4-to_infinity_and_beyond process
3+
4+
kill "$(pgrep -f 4-to_infinity_and_beyond)"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
# Kills the 4-to_infinity_and_beyond process.
3+
4+
pkill -f 4-to_infinity_and_beyond
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
# Kills the 4-to_infinity_and_beyond process.
3+
4+
pkill -f 7-highlander
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
# Displays "To infinity and beyond" indefinitely with
3+
#+ a sleep 2 in between each iteration.
4+
# Displays "I am invincible!!!" in between each iteration.
5+
6+
while true
7+
do
8+
echo "To infinity and beyond"
9+
sleep 2
10+
trap 'echo "I am invincible!!!"' SIGTERM
11+
done
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
# Kills the process 7-highlander.
3+
4+
pkill -f -SIGKILL 7-highlander
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# Indefinitely writes "I am alive" to the file /tmp/my_process.
3+
# Pauses two seconds in between each message.
4+
5+
while true
6+
do
7+
echo "I am alive!" >> /tmp/my_process
8+
sleep 2
9+
done

0 commit comments

Comments
 (0)