shell/ not bash/
This commit is contained in:
parent
a725b5c0de
commit
4870919531
15 changed files with 0 additions and 0 deletions
23
bash/cat.sh
23
bash/cat.sh
|
|
@ -1,23 +0,0 @@
|
|||
# cat for Markdown in my ultralight writing database
|
||||
# wherein concatenated filed need a "\n---\n\n" between them.
|
||||
|
||||
#############################################################################
|
||||
# cat with file headers | replace with section string | remove first instance
|
||||
|
||||
# NOTE: only need to add one newline, because the header inserted by tail
|
||||
# implicitly adds two : \n==> foo <==\n
|
||||
tail -n +1 "$@" | sed 's/^==> .* <==$/---\n/g' | tail -n +3
|
||||
|
||||
|
||||
##############################
|
||||
# failed approaches
|
||||
|
||||
# find . -type f -name "$@" -exec cat {} \; -printf "\n---\n\n"
|
||||
|
||||
# this leaves one trailing, could cat the whole thing and then cut the tail off
|
||||
# MDCATALL=`for i in "$@";
|
||||
# do
|
||||
# cat $i
|
||||
# echo '\n---\n\n'
|
||||
# done`
|
||||
# echo $MDCATALL | head -n +2
|
||||
Loading…
Reference in a new issue