Mercurial > hg > config
annotate bin/example/args.sh @ 675:f8813ed3d015
STUB: bin/example/pid.sh
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 06 May 2014 15:18:40 -0700 |
parents | 5bee5c55a7a0 |
children |
rev | line source |
---|---|
412
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
1 #!/bin/bash |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
2 |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
3 function foo { |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
4 echo '$*'="$*" |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
5 echo '$@'="$@" |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
6 echo '$#'="$#" |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
7 if [[ "$*" == "test string" ]] |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
8 then |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
9 echo '$*' == "test string" |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
10 if [[ "$@" == "test string" ]] |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
11 then |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
12 echo '$@' == "test string" |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
13 else |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
14 echo '$@' != "test string" |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
15 fi |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
16 fi |
5bee5c55a7a0
args test + bash overrides hg safety
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
17 } |