Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- trap "cleanup" SIGUSR1
- export TOP_PID=$$
- echo $TOP_PID
- function cleanup() {
- rm serwerfifo
- kill -9 $TOP_PID
- }
- function respond() {
- read -r path number <<< "$1"
- path="${path}/klientfifo"
- number=$number**$number
- echo $number > $path
- }
- trap "" SIGHUP
- trap "" SIGTERM
- mkfifo serwerfifo
- while true
- do
- input=$(< serwerfifo)
- respond $input
- sleep 1
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement