Advertisement
s243a

sed_loop_test

Jan 15th, 2020
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/sh/
  2. WKDIR=$(realpath ~)
  3. sed_script='${WKDIR}/test_sed_script'
  4. cmd_script='${WKDIR}/cmd_sed_script'
  5. local fifo="/var/tmp/getoptions.$$.$RANDOM"
  6. mkfifo $fifo || {
  7. echo "$(basename $0): getoptions: Error creating named pipe. Exiting." >&2 exit 2 }
  8. ( sed -f "$sed_script" "$fifo" >$fifo ; rm -f $fifo ) &
  9. trap 'echo Received SIGPIPE >&2' SIGPIPE
  10. globalvar=
  11. while read; do
  12. # first loop :
  13. done < <($cmd_script)
  14. ## do something with globalvar
  15. #while read; do
  16. # #second loop :
  17. #done <$fifo \trap - SIGPIPE
  18.  
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement