diff options
| author | grothedev <grothedev@gmail.com> | 2022-01-22 16:42:54 -0500 |
|---|---|---|
| committer | grothedev <grothedev@gmail.com> | 2022-01-22 16:42:54 -0500 |
| commit | 84dec96006d7c049fe7c1216087e369513a3c813 (patch) | |
| tree | ab62819818a90491db064164a28344afff35bd0d /pull_thoughts | |
| parent | eb84970e2d2a3e1a0d0f309ee5438d1d4243bb4f (diff) | |
pull_thoughts: append by default
Diffstat (limited to 'pull_thoughts')
| -rwxr-xr-x | pull_thoughts | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/pull_thoughts b/pull_thoughts index de81c2f..6eaf769 100755 --- a/pull_thoughts +++ b/pull_thoughts @@ -4,6 +4,7 @@ tdir="/srv/www/thesite/public/t/" #t for 'text' i guess buffer=${HOME}"/.tmp/tbuff/" #buffer dir to temporarily store the downloaded files +PREPEND=false DBG=0 if [[ $1 ]]; then DBG=1; fi @@ -37,13 +38,18 @@ for f in `ls $buffer`; do if [ -e ~/doc/${f} ]; then fog=~/doc/${f} - if [[ $DBG ]]; then echo "backing up "${fog}; fi - cp ${fog} ${fog}.prev - if [[ $DBG ]]; then echo "prepending new data"; fi - cat ${buffer}/${f} > ${fog} - echo "" >> ${fog} - cat ${fog}.prev >> ${fog} - rm ${fog}".prev" + if [[ $PREPEND ]]; then + if [[ $DBG ]]; then echo "backing up "${fog}; fi + cp ${fog} ${fog}.prev + if [[ $DBG ]]; then echo "prepending new data"; fi + cat ${buffer}/${f} > ${fog} + echo "" >> ${fog} + cat ${fog}.prev >> ${fog} + rm ${fog}".prev" + else + if [[ $DBG ]]; then echo "appending new data"; fi + cat ${buffer}/${f} >> ${fog} + fi else cat ${buffer}/${f} > ~/doc/${f} fi |
