Mercurial > hg > config
annotate bin/example/interpolate.sh @ 864:7191914724f0
[git] update name and fix syntax
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Thu, 07 Jun 2018 14:33:07 -0700 |
parents | 565875bc93b7 |
children |
rev | line source |
---|---|
852
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
1 #!/bin/bash |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
2 |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
3 if [ "$#" == "0" ] |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
4 then |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
5 echo "Usage: $0 file [file] [...]" |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
6 exit 1 |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
7 fi |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
8 |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
9 for arg in "$@" |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
10 do |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
11 eval "cat <<EOF |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
12 $(<$arg) |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
13 EOF |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
14 " 2> /dev/null |
565875bc93b7
[bash example] interpolatation skeleton
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
15 done |