From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23608-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 5bda9616 for ; Sun, 9 Sep 2018 01:23:17 +0000 (UTC) Received: (qmail 25581 invoked by alias); 9 Sep 2018 01:23:00 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23608 Received: (qmail 16825 invoked by uid 1010); 9 Sep 2018 01:23:00 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f50.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(74.125.82.50):SA:0(-1.9/5.0):. Processed in 1.963006 secs); 09 Sep 2018 01:23:00 -0000 X-Envelope-From: luomat@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=B6w7lsBdlrDAe+fIytHYMImeEJH1fg5YREIexJdsVho=; b=HYJcLwG1ebT/LMYvP1zo6FqVXGfhtRNFwtg7g2DQBzO1tgzyWAZGte1PO8VjRSER3k fNa+WV9QTnyke2K+/CebjKXw8CUMKKEai9Ha61RUs8o8TqwNdb0a29N+fe7k7qsCwnmB dXyPjO7JX6SpFEg4aNs2JGJvKTnnYCyB/P9YCoCiX8ro2h5tTWc08q7Uq6oLlRW7DIge oSqIk4zPfEbEL6fv3+eWlPmTZkYAqL1Gmi4PqdL2uY5f6BxFPcbyfbtJdZ8GQ5gifity VMUYBcoyF7d13xZLzHhS9yPEDfDojtDC4KJoX1kn+2ac4r4MtEvrD/zU+GY9ud3ikLUK Jfyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=B6w7lsBdlrDAe+fIytHYMImeEJH1fg5YREIexJdsVho=; b=fjvMrXiZgt4Va7fP0cdvdUW5C+exCK3mSj/dFKjFPlJurqBZMIvA27F618qB/KajmQ h2OsG7m6Zv772f3hatuuARCcIRefAU+YSuT+pLPCsnZqIgM9LFtNQTkGFlIOBD9FRORA 3E7q2bFY3zkYwbAdPl9fJVALiuPHOl21I9uB+AyxTQq4Z0v+4BJYYToOWNHjCtGv8hmG HdLdy5UyZOtDieNa7Py2QUXqBpl+WBzEwA0x/yDBwPZOh/WLFgNqSjG8lsB6MCpkOcZW F8/usSWccuw/XrvM/CFjP9Vl4Kttfy+ItFP2IcgCs+C8BrLfRX7OQ1Mh4uT8OWoEi3Em bPsA== X-Gm-Message-State: APzg51CYQOoywnoY2tz2tPQrYS/VEnrM23MPIpSloQoRXxM4EAnYpQ5l DWcsrwbUXgvfrlUBzXHLxKXEfASMZ12bxMKmOmHPfA== X-Google-Smtp-Source: ANB0VdbEgXMXSdVKSYwFJJlz0tq/Xfgr0M4ut3fcn7psx3F+5y8IwVIPTunLjdm0FGVtmnCm08DmWach8yRPpevyhZc= X-Received: by 2002:a1c:a386:: with SMTP id m128-v6mr9126337wme.139.1536456174234; Sat, 08 Sep 2018 18:22:54 -0700 (PDT) MIME-Version: 1.0 From: TJ Luoma Date: Sat, 8 Sep 2018 21:22:17 -0400 Message-ID: Subject: How do you decide whether to make something a function or a script? To: Zsh-Users List Content-Type: multipart/alternative; boundary="0000000000007a7475057566145e" --0000000000007a7475057566145e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've been moving some of my more elaborate functions into their own files and using the autoload feature to import them into other scripts. But it's gotten me to wonder: Why make any functions at all? Why not just make them all scripts? If they are scripts in the $PATH then you can just call them by name and they work in the login shell or in scripts. If they are functions, you have to autoload them first. So I've gotten to wonder=E2=80=A6 what makes you make something a function = vs a script? TjL -- TJ Luoma TJ @ MacStories Personal Website: luo.ma (aka RhymesWithDiploma.com ) Twitter: @tjluoma --0000000000007a7475057566145e--