From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 92c74021 for ; Tue, 17 Dec 2019 12:35:00 +0000 (UTC) Received: (qmail 13194 invoked by alias); 17 Dec 2019 12:34:53 -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: 24569 Received: (qmail 12809 invoked by uid 1010); 17 Dec 2019 12:34:53 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f47.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25663. spamassassin: 3.4.2. Clear:RC:0(209.85.221.47):SA:0(-2.0/5.0):. Processed in 0.759511 secs); 17 Dec 2019 12:34:53 -0000 X-Envelope-From: luomat@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.221.47 as permitted sender) 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=bqQycVe2YIYjrOUpB5wBPGO10jBOU2d9IX3w2JU/eLA=; b=VuMI0F1G/Q5Ra2F2IDpmdb6LD/PXKTKpLs0GbciA4V782WDUVWgoSk4uam2NHSnz1d Op4u24atIWb2UE2x2mOOs7KXcUtjUGfmJFDmmSWo39UK8bi3Z4r/ORfvxCCua3Mfu6zW OrGPHNDQjAX+WSFiYJz0dM+ITd58cwMjaQgaQhqDUr+quvkeOamu8tIkKMKd7LvaG9dZ WtZ0P9RjJqBjBxVMzaraD1kTW4CUjscBZlx5i4lGN/XQpQRoVmdQY7NIY9NYBMfq/Npd vvPpJZxA9LkUsyE2ssSrjH+CVjj0o+O/lH53dAS3GT1af/6GrSuQn3gxpdwXaWyY6tNZ thkg== X-Gm-Message-State: APjAAAVqzobB82FNEFSK40E7rbfggGFQjKBU7gGq54JVbHOGZsUaD8Qt l6bnAMvqX3MTXmWRcefOWHALKUBXIFMk7dJ3azlKqTkKWnHk5g== X-Google-Smtp-Source: APXvYqw++wZHU5bm58slbdpByanOSJ2/WXgGwMlmDsfQiUM2kFNMq2ne0oHhGzCjWkP8+iU028T2+reDbDAL/sUtgCA= X-Received: by 2002:adf:e812:: with SMTP id o18mr35589112wrm.127.1576586057636; Tue, 17 Dec 2019 04:34:17 -0800 (PST) MIME-Version: 1.0 From: TJ Luoma Date: Tue, 17 Dec 2019 07:33:41 -0500 Message-ID: Subject: is '&' the right way to do this? To: Zsh MailingList Content-Type: text/plain; charset="UTF-8" Every now and again I realize that I've developed a habit, but it isn't the "right" or "best" way to do something, so I'm asking what may be an obvious question. If I am in a zsh shell script (not interactive) and want to have it do something tangential which does not block the progress of the main/parent script, then I usually put it in (parentheses) with a & at the end of the line So, to use a dramatic example: #!/bin/zsh -f echo "This is the start" ( find / -type f -print > /tmp/filelist.txt ) & echo "This is the end" exit 0 My intention is that the script would exit long before `find` was done writing to '/tmp/filelist.txt'. Question #1: Would it be better for any reason to use `&|` such as: #!/bin/zsh -f echo "This is the start" ( find / -type f -print > /tmp/filelist.txt ) &| echo "This is the end" exit 0 or is the use of `&|` really only beneficial for interactive shells? Question #2: Are there better ways of doing this? Thanks! TjL