Proper use of quotes for running the command

$1 on a shell has a special meaning and inside of double quotes (") it will be expaned to an empty string. Using single quotes fixes the issue.
This commit is contained in:
Gabriel Nicolas Avellaneda 2019-04-05 14:06:00 -03:00 committed by GitHub
parent 85ff65f1e1
commit a1013d1324

View file

@ -33,7 +33,7 @@ Rewriting can be controlled using the following annotations:
Create an Ingress rule with a rewrite annotation: Create an Ingress rule with a rewrite annotation:
```console ```console
$ echo " $ echo '
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
@ -50,7 +50,7 @@ spec:
serviceName: http-svc serviceName: http-svc
servicePort: 80 servicePort: 80
path: /something/?(.*) path: /something/?(.*)
" | kubectl create -f - ' | kubectl create -f -
``` ```
In this ingress definition, any characters captured by `(.*)` will be assigned to the placeholder `$1`, which is then used as a parameter in the `rewrite-target` annotation. In this ingress definition, any characters captured by `(.*)` will be assigned to the placeholder `$1`, which is then used as a parameter in the `rewrite-target` annotation.