V
V
vsespb2013-12-02 22:42:13
bash
vsespb, 2013-12-02 22:42:13

In what cases does the following Shell expression not work?

I have a repository with the program and installation instructions on github. They have the following line:

echo "deb http://SOMEURL/debian/current $(lsb_release -sc) main"|sudo tee /etc/apt/sources.list.d/SOMEREPO.list

For most users, it works fine, but with an enviable frequency I notice something like this in the web server logs
"GET /debian/current/dists/$(lsb_release/-sc)/binary-i386/Packages.gz HTTP/1.1" 404 168 "-" "Debian APT-HTTP/1.3 (0.9.7.9)"

The question is, how does this happen to users?, why is the expression $(lsb_release -sc)not executed correctly? Tried in bash/dash/zsh - everything seems to be ok.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vsespb, 2013-12-03
@vsespb

Found out that this command does not work in fish. fish is not compatible with the shell, so they don’t set it as a system one for scripts, but they put it how it went for themselves. And these commands are just entered manually by the copy-paste method.
After that, I remembered where I can find a live user who seemed to have such problems. It turned out that he did not have fish. Instead, he has a rasberry-pi. And there is no such command in debian. At all. So it is not necessarily included in the distro, it may not be included in some minimal install.
However, if it is not included in the distro, the lsb_release line should not be in the output file and in the URL, so this is a new problem.
Conclusion - lsb_release in this form is not suitable for writing installation instructions.

I
Ilya Evseev, 2013-12-03
@IlyaEvseev

Is it possible to find out his email by the ip-address of the client? Then you could ask him directly.
Option number 2 - if the web server saw "lsb_release" in the request, issue a 4xx error code with the explanation "contact me, I want to fix this bug!"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question