Updated scripts

This commit is contained in:
z3rOR0ne 2022-07-07 13:05:06 -07:00
parent eef4fdf99c
commit d0aead5a9c
14 changed files with 386 additions and 99 deletions

30
scripts/wpipe.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
# https://www.linuxjournal.com/content/using-named-pipes-fifos-bash
# To be used in conjunction with rpipe.sh (demonstrating mkfifo, or named pipes)
pipe=/tmp/testpipe
if [[ ! -p $pipe ]]; then
echo "Reader not running"
exit 1
fi
if [[ "$1" ]]; then
echo "$1" > $pipe
else
echo "Hello from $$" > $pipe
fi
# Example Output:
# $ sh rpipe.sh &
# [3] 23842
# $ sh wpipe.sh
# Hello from 23846
# $ sh wpipe.sh
# Hello from 23847
# $ sh wpipe.sh
# Hello from 23848
# $ sh wpipe.sh quit
# Reader exiting