Skip to content

Commit e24c749

Browse files
committed
add demos
1 parent 3d1885f commit e24c749

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

labs/demos/longproc.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
#
3+
# longproc.sh
4+
# Copyright (C) 2014 ynonperek <ynonperek@Ynons-MacBook-Air.local>
5+
#
6+
# Distributed under terms of the MIT license.
7+
#
8+
9+
(sleep 60; echo bye > talk) &
10+
TOKILL=$!
11+
12+
while read LINE < talk
13+
do
14+
if [[ $LINE == "bye" ]]; then
15+
kill -9 $TOKILL
16+
exit 1
17+
fi
18+
done
19+

labs/demos/server.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
#
3+
# server.sh
4+
# Copyright (C) 2014 ynonperek <ynonperek@Ynons-MacBook-Air.local>
5+
#
6+
# Distributed under terms of the MIT license.
7+
#
8+
9+
mkfifo talk
10+
11+
while read LINE < talk
12+
do
13+
if [[ $LINE == "ls" ]]; then
14+
ls
15+
elif [[ $LINE == "bye" ]]; then
16+
exit
17+
fi
18+
done
19+

0 commit comments

Comments
 (0)