curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Exit status not reflecting 404 with --fail

From: Timothe Litt <litt_at_acm.org>
Date: Mon, 27 Nov 2023 15:26:40 -0500

On 27-Nov-23 15:02, Paul Gilmartin via curl-users wrote:
> On 11/27/23 10:09:03, Petr Pisar via curl-users wrote:
>
>>>
>>> Because of dueling package managers, I have a script that parses
>>> PATH and reports (ls -l) each instance it finds.
>>>
>> Bash builtin "type -a" does that.
> .
> Thanks.  Trying it, I see it reports both aliases and paths,
> presumably in search order.
>
> I don't see a man page that exactly describes that.
>
I didn't mean to start an alternatives discussion.

But in defense of which, you don't need more than this 1 line to handle
all of the above:

ls -l $(which -a curl | grep -v =)

-a checks aliases and paths.  The grep excludes any alias definitions
from the ls (their expansions follow and are listed)

If you're not feeding the output into ls (or something else), which -a
suffices to tell a human what's going on.

Enjoy.

Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed.



-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-11-27