From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23434 invoked from network); 2 Mar 2023 14:16:07 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 2 Mar 2023 14:16:07 -0000 Received: (qmail 9331 invoked by uid 550); 2 Mar 2023 14:16:03 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 9288 invoked from network); 2 Mar 2023 14:16:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=s1PzOZoJT7+q4PzHz62VzsvilnXZg0UeOJU4d4HBTGA=; b=jxZtX1Lt8O1qD8wV18bEEvG2f+SUfa7r/r6BxXZQJyrAdYDUvb5Ab7Wd4oM0dRndMg /QKP8Jg+6/dEdgKtEm52GBaev0h9s5JJjE9B94AzfFmmcS7QxuZKK7/n9PAxNjAq+uIY i0+xORAImmynNbFYOO7yc48UNT2RsOx5UpjL7P1uvbH/j6Dy7C2kMMBmZHP6xJ193VOh vN9AuelG1pn/AFjltgHXUl3GBPm10B5EIvbJl8+qoO1u8+u2+AFLOcOA4FSaLTcf/N3i r6UfDhk/SYQkj6pjTuZ3F+032/f2oDwykTSaIHfwq15dKwgIMnwL/JKpoUVOj5PEuiq8 5mLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=s1PzOZoJT7+q4PzHz62VzsvilnXZg0UeOJU4d4HBTGA=; b=C1Lr+XuoYy48b87+iCaip4irVb/UChUtqjpf2GxL33x3DMLVCF+LTLdURCsI9WwHeC o8xLW1sju+gBaos+wPR0YRoGFZL8agFiHKUGFkOeX2ZGkTNpoB5LgKbsa4OkrO6M1lmy jiAy0kjGjGtE2OJcv8ZEU6SYZtw6OAdUVEo19Q90+fnhX19kn+9GOOvdcTYby0aemZ/U ylONOLGMT3LrpEq+gfl+yGtQiWOc/L8HEzGz6TdNyXSpWQT/GDIo4aCJnoEQ+oaaC7We NHujVmkVPErM0k+x3niezVzegpW7IVVUZtKzx67H6NG1+orWRZWQ3IcL2DbLcIaKNyW/ VS0w== X-Gm-Message-State: AO0yUKVCc/DNJGtuN+Y4vy9LvI3DCJDDZCFzNnC3I/+oDZDHMmMvW93G Y0m96+W2WIC3F5xZH0sHfB53SIe41NnbKo57uuIQSe0/ X-Google-Smtp-Source: AK7set9bGRJlsTlPnjp753xC6mwtxa5NOeL0DcpGo9qxWZfOONQ8MLNAWBxMM7lDgztQnX2q+Bv2tdcyCRDwoQ87Zl4= X-Received: by 2002:a1f:f884:0:b0:406:1ef2:7bc7 with SMTP id w126-20020a1ff884000000b004061ef27bc7mr6264357vkh.2.1677766549969; Thu, 02 Mar 2023 06:15:49 -0800 (PST) MIME-Version: 1.0 From: Paul Schutte Date: Thu, 2 Mar 2023 16:15:38 +0200 Message-ID: To: musl@lists.openwall.com Content-Type: multipart/alternative; boundary="0000000000003a21a505f5eb778e" Subject: [musl] Off topic question about shebang and exec() --0000000000003a21a505f5eb778e Content-Type: text/plain; charset="UTF-8" Hi all I apologize for abusing the knowledge of the people on this list, but I know they will know the answer. Google does not provide a usable answer. I am busy writing a toy language and I would like it to be used as both a compiler and "interpreter" I would like it to compile the source and then run the resulting binary when the source file is called via the shebang and it should just do a normal compile when called with "compile code.src" argv[0] contains the path to the compiler in both cases, which makes sense. Is there any way to determine which method was used to call the compiler? Kind Regards Paul --0000000000003a21a505f5eb778e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all

I apologize for abusing the know= ledge of the people on this list, but I know they will know the answer. Goo= gle does not provide a usable=C2=A0answer.

I am bu= sy writing a toy language and I would like it to be used as both a compiler= and "interpreter"

I would like it to co= mpile the source and then run the resulting binary when the source file is = called via the shebang and it should just do a normal compile when called w= ith "compile code.src"

argv[0] contains = the path to the compiler in both cases, which makes sense.

Is there any way to determine which method was used to call the co= mpiler?

Kind Regards
Paul
--0000000000003a21a505f5eb778e--