From 80882d5232c40da65b0ab6efdc777ba60cff7b90 Mon Sep 17 00:00:00 2001
From: "Vadim (vadcx)"
Date: Tue, 7 Nov 2023 19:30:29 +0100
Subject: [PATCH] Replace deprected command: which
"which" was deprecated in favour of "command -v" in Debian.
Further reading: https://lwn.net/Articles/874049/
---
book/04-git-server/sections/setting-up-server.asc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/book/04-git-server/sections/setting-up-server.asc b/book/04-git-server/sections/setting-up-server.asc
index bbb082956..1b53a59ba 100644
--- a/book/04-git-server/sections/setting-up-server.asc
+++ b/book/04-git-server/sections/setting-up-server.asc
@@ -96,7 +96,7 @@ To do so, you must first add the full pathname of the `git-shell` command to `/e
[source,console]
----
$ cat /etc/shells # see if git-shell is already in there. If not...
-$ which git-shell # make sure git-shell is installed on your system.
+$ command -v git-shell # make sure git-shell is installed on your system.
$ sudo -e /etc/shells # and add the path to git-shell from last command
----
@@ -104,7 +104,7 @@ Now you can edit the shell for a user using `chsh -s `:
[source,console]
----
-$ sudo chsh git -s $(which git-shell)
+$ sudo chsh git -s "$(command -v git-shell)"
----
Now, the `git` user can still use the SSH connection to push and pull Git repositories but can't shell onto the machine.