From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by mx.groups.io with SMTP id smtpd.web10.22340.1669131632094844668 for ; Tue, 22 Nov 2022 07:40:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=d1tsrntS; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 199.106.114.38, mailfrom: quic_rcran@quicinc.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1669131632; x=1700667632; h=from:message-id:date:mime-version:subject:to:references: in-reply-to:content-transfer-encoding; bh=N2mZpqXBo/FcMj5BxjDKu7wgwPcEay1mkfWh15XjWX0=; b=d1tsrntS+vr95K8+gniQeLsMBucFltL5SwXfUfFbilNwLrc5o2Bdg5Vw bNnAtlr9gNBWuQSFSFOzWED7vdgOzAtUu57+OIa0vvgOgcNLRRhjKDIRv HLU23cEhqByDqSn3LCEUO5IG4OCP94/sCLHz9Dj/eSVNfFzHaqO95sTUx 4=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 22 Nov 2022 07:40:31 -0800 From: "Rebecca Cran" X-QCInternal: smtphost Received: from nasanex01b.na.qualcomm.com ([10.46.141.250]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2022 07:40:31 -0800 Received: from [10.110.88.21] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 22 Nov 2022 07:40:30 -0800 Message-ID: <0bb285e2-ca66-f78a-7da9-ffd13473b61a@quicinc.com> Date: Tue, 22 Nov 2022 08:40:30 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [edk2-devel] edksetup.sh: fix for non POSIX whereis(1) To: , , References: In-Reply-To: Return-Path: rebecca@quicinc.com X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) Content-Language: en-US Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit On 11/21/22 15:22, Pedro Falcato wrote: > I kind of dislike your solution. Does NetBSD ship /bin/which by default? > I think replacing whereis with "which -a" would be a lot better. > I don't think there's a 100% standard way to do this in POSIX, as which > isn't POSIX either, and your solution seems... hacky? "command" seems to be the POSIX way to do this? https://pubs.opengroup.org/onlinepubs/9699919799/ Though "whereis python3" shows the following on my system: python3: /usr/bin/python3.9-config /usr/bin/python3.9 /usr/bin/python3 /usr/lib/python3.9 /usr/lib/python3 /etc/python3.9 /etc/python3 /usr/local/lib/python3.9 /usr/include/python3.9 /usr/share/python3 /usr/share/man/man1/python3.1.gz "which -a python3" returns: /usr/bin/python3 /bin/python3 And "command -p -v" returns: /bin/python3 I don't know if we need all the results from "whereis"? -- Rebecca Cran