Re: Exit status not reflecting 404 with --fail

Ray Satiro via curl-users <[email protected]>
Newsgroups gmane.comp.web.curl.general
Message-ID <[email protected]>
On 11/27/2023 3:26 PM, Timothe Litt via curl-users wrote:
> 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.
>

In Ubuntu 16 LTS type -a will show an alias but which -a won't. For 
example I use an alias 'curl.old' for the packaged curl:

owner@ubuntu1604-x64-vm:~/tmp/osslroot$ which curl.old
owner@ubuntu1604-x64-vm:~/tmp/osslroot$ which -a curl.old
owner@ubuntu1604-x64-vm:~/tmp/osslroot$ type -a curl.old
curl.old is aliased to `LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libcurl.so 
/usr/bin/curl'
owner@ubuntu1604-x64-vm:~/tmp/osslroot$ type curl.old
curl.old is aliased to `LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libcurl.so 
/usr/bin/curl'

If curl.old existed as a program and an alias then which -a would only 
show the programs.


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.