Permalink
Browse files

docs: simpler echo to file, remove temp file.

  • Loading branch information...
1 parent 2699a1b commit c0b6d5ef616910291557b2cb0c0c846aa17b3bd6 @mworrell mworrell committed Mar 22, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 doc/ref/tags/.get_tags
View
@@ -1,10 +1,10 @@
#!/bin/sh
-echo <<EOF
+echo '
# operate on the first lines of the identifier_to_keyword fun
# that mentions open_tag (guard clause), and down until the
# the line containing "Type ="
/identifier_to_keyword.*open_tag/,/Type =/ {
- # delete lines that doesn't have any " in them
+ # delete lines that does not have any " in them
/^[^"]*$/ d
# delete everyting upto the next quoted word, and the quotes
@@ -14,7 +14,7 @@ echo <<EOF
# strip out spurious erlang syntax scrap
s/[],]//g
- # get rid of all close tags (those prefixed with 'end')
+ # get rid of all close tags (those prefixed with "end")
s/end[a-z]*//g
# print whats left
@@ -23,6 +23,8 @@ echo <<EOF
# delete everything else
d
-EOF > /tmp/ztgsed$$
+' > /tmp/ztgsed$$
+
exec sed -f /tmp/ztgsed$$ -- "$@"
-# rm /tmp/ztgsed$$
+
+rm /tmp/ztgsed$$

4 comments on commit c0b6d5e

Owner

kaos replied Mar 22, 2013

why the "simpler" echo? Now there can't be unescaped single quotes in the echo'ed string... so I'd argue it's not really simpler... just different syntax with slightly different caveats..

Owner

mworrell replied Mar 22, 2013

In my test I couldn't redirect the echo to a file. Might be a OS X thing.
This way it works.

Owner

kaos replied Mar 22, 2013

Aha.. if you're like me and prefer the <<EOF .... EOF thingy, try replacing echo with cat instead.

Owner

kaos replied Mar 22, 2013

Ah, right now I see. It used to be the sed in there... so sed - -- <<EOF ... which means sed reads stdin. echo <<EOF ... doesn't work, since echo doesn't read stdin... but cat does... :)

Please sign in to comment.