Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

finish generate-file-from

  • Loading branch information...
commit 00e3df0a517a3bf6b2914166afe690913e6c1040 1 parent 5dcec04
pflanze authored August 02, 2012

Showing 2 changed files with 14 additions and 4 deletions. Show diff stats Hide diff stats

  1. 7  README
  2. 11  generate-file-from
7  README
@@ -67,3 +67,10 @@ PS. the Makefile now uses absolute paths; this means, you can do:
67 67
  somehost:/etc/ssh# ln -s /opt/chj/ssh-config-gen/Makefile
68 68
 
69 69
 and then just run 'make' from /etc/ssh/.
  70
+
  71
+There's also generate-file-from, which allows you to write your own
  72
+Makefile with an entry like:
  73
+
  74
+ data: data-in
  75
+	 /opt/chj/ssh-config-gen/generate-file-from data data-in
  76
+
11  generate-file-from
@@ -2,10 +2,13 @@
2 2
 
3 3
 set -eu
4 4
 
5  
-w=`whami`
  5
+to="$1"
  6
+from="$2"
6 7
 
7  
-/opt/chj/ssh-config-gen/filter_file assign-in \
  8
+w="${WHAMI-`whami`}"
  9
+
  10
+/opt/chj/ssh-config-gen/filter_file "$from" \
8 11
 | cpp -Dnetwork_"$w"=1 \
9  
-| filter_whitespace > assign.new
  12
+| /opt/chj/bin/filter_whitespace > ."$to".new
10 13
 
11  
-mv assign.new assign
  14
+mv ."$to".new "$to"

0 notes on commit 00e3df0

Please sign in to comment.
Something went wrong with that request. Please try again.