Skip to content

Commit 6c8ca7c

Browse files
committed
minor #7918 Avoid backticks in shell scripts (greg0ire)
This PR was merged into the 2.7 branch. Discussion ---------- Avoid backticks in shell scripts - $() should be preferred : http://mywiki.wooledge.org/BashFAQ/082 - it makes it easier to discuss these lines on Slack (or any markdown-compatible thing). Commits ------- f1e7cf0 Avoid backticks in shell scripts
2 parents e510f67 + f1e7cf0 commit 6c8ca7c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

setup/file_permissions.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ needed permissions:
3434
$ rm -rf app/cache/*
3535
$ rm -rf app/logs/*
3636
37-
$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
37+
$ HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1)
3838
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
39-
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
39+
$ sudo chmod +a "$(whoami) allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
4040
4141
3. Using ACL on a System that Supports ``setfacl`` (Linux/BSD)
4242
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -48,10 +48,10 @@ following script to determine your web server user and grant the needed permissi
4848

4949
.. code-block:: terminal
5050
51-
$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
51+
$ HTTPDUSER=$(ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1)
5252
# if this doesn't work, try adding `-n` option
53-
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
54-
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
53+
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX app/cache app/logs
54+
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX app/cache app/logs
5555
5656
.. note::
5757

0 commit comments

Comments
 (0)