Skip to content

Commit 5ddbb25

Browse files
rjcdanpat
authored andcommitted
Use an environment variable instead of command substitution (#5364)
`$PWD` is already there so use it instead of running `pwd(1)` in a subshell each time.
1 parent 9ba60d0 commit 5ddbb25

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@ Download OpenStreetMap extracts for example from [Geofabrik](http://download.geo
5858

5959
Pre-process the extract with the car profile and start a routing engine HTTP server on port 5000
6060

61-
docker run -t -v "$(pwd):/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
61+
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
6262

63-
The flag `-v "$(pwd):/data"` creates the directory `/data` inside the docker container and makes the current working directory `"$(pwd)"` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `"$(pwd)/berlin-latest.osm.pbf"` on the host.
63+
The flag `-v "${PWD}:/data"` creates the directory `/data` inside the docker container and makes the current working directory `"${PWD}"` available there. The file `/data/berlin-latest.osm.pbf` inside the container is referring to `"${PWD}/berlin-latest.osm.pbf"` on the host.
6464

65-
docker run -t -v "$(pwd):/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
66-
docker run -t -v "$(pwd):/data" osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
65+
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
66+
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
6767

6868
Note that `berlin-latest.osrm` has a different file extension.
6969

70-
docker run -t -i -p 5000:5000 -v "$(pwd):/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
70+
docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm
7171

7272
Make requests against the HTTP server
7373

0 commit comments

Comments
 (0)