Created
December 4, 2011 05:20
-
-
Save deepakjois/1429263 to your computer and use it in GitHub Desktop.
Simple awk -> sed simplification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit d2bc95ebf2545b1d86463812f82917d943d8f77b | |
Author: Deepak Jois <[email protected]> | |
Date: Sat Dec 3 21:18:13 2011 -0800 | |
complicated awk -> simpler sed | |
diff --git a/post-fiddle-via-gist.sh b/post-fiddle-via-gist.sh | |
old mode 100644 | |
new mode 100755 | |
index 328b5bd..fd6d8de | |
--- a/post-fiddle-via-gist.sh | |
+++ b/post-fiddle-via-gist.sh | |
@@ -127,11 +127,7 @@ GIST_ID=$( | |
) | | |
# Insert commas between each JSON field | |
- # FIXME Crude awk script. Find better way | |
- awk ' | |
- NR == 1 { prev = $0 } | |
- NR > 1 { print prev "," ; prev=$0 } | |
- END { print }' | | |
+ sed '$!{s/$/,/;}' | | |
# Insert gist template for posting to API | |
layout | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment