Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cat email.txt
- | { tee >(sed -ne '1,/^$/p' | process_header >&3)
- | sed -e '1,/^$/d' | process_body; } 3>&1
- | sendmail -oi -- test@example.org
- cat email.txt
- | { tee >(sed -ne '1,/^$/p' >&3; : branch off the header)
- | sed -e '1,/^$/d'
- | tee >(wc -l >~/.fifo); : number of body lines into pipe; } 3>&1
- | xargs -I% -a ~/.fifo sed -e '1,/^$/{/^Subject:/Is/$/ (%)/}'
- | sendmail ...
- cat email.txt
- | { tee >(sed -ne '1,/^$/p' >&3)
- | sed -e '1,/^$/d' | tee >(wc -l >&4); } 3>&1
- | xargs -I% -a /dev/fd/4 sed -e '1,/^$/{/^Subject:/Is/$/ (%)/}
- | sendmail ...
- xargs: Cannot open input file ‘/dev/fd/4’: No such file or directory
- bash: 4: Bad file descriptor
- nol="$(sed -e '1,/^$/d' email.txt | wc -l)"
- sed -e "1,/^$/{/^Subject:/Is/$/ ($nol)/}" email.txt | sendmail ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement