Skip to content

Instantly share code, notes, and snippets.

@retrospectacus
Created October 1, 2020 16:11
Show Gist options
  • Save retrospectacus/7c756cfcffe155cca0bc1e90b2fa04c9 to your computer and use it in GitHub Desktop.
Save retrospectacus/7c756cfcffe155cca0bc1e90b2fa04c9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
tr=trigger
tr='==============_AUTOGENERATED_-_EDITS_BELOW_WILL_BE_CLOBBERED'
[ ! -f test ] && cat <<EOF >test
this
is a
trigger
test
some config is
probably here
EOF
day=$(date +%A)
cat <<EOF >data
this is
$day's data.
EOF
cat \
<(awk "/$tr/{exit}{print}" test) \
<(echo "$tr") \
<(date) \
<(uname -a) \
data \
> output
cat output
mv output test
# make external changes to ./test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment