From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12327 invoked by alias); 25 Nov 2012 06:56:08 -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: X-Seq: 17431 Received: (qmail 15666 invoked from network); 25 Nov 2012 06:55:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at skepticism.us does not designate permitted sender hosts) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=YKrAd6Wo8BHQYH5HaFN24kNErOjsB0qs1ikILFDMbdA=; b=HprFBdxXrmf1HCYtXNc+8Cs7XMD0trRIz7OA3pGzi5Y3dOFvW5AHhkNkc8kL48Fu3K 46FKOMyWA1FFSr3pDsCN3ZqNUwsg7MX8Md4yZzE0m81ec/bETEDZUZwZZF1UJ+cKp2HK X0KkOYWZ4bEZlXxMoUgfkyRlrumSj2vUS+M4YmXIh7pAxqT2jmini1N+U7V0GCsuQ1xw ophOUz5wpvIU3pwt4aQ9lZmWaD43M/Z6v6GD8eEj9XjTIR/lztne6XMQrz+G+6RBDY8K QjFYLiaXzqQFjXqEqGO+kfh47xSsy2UZuVxwLS/j1Vy9d5KH7Ya4V48bBCxN7SpIZhYX kdIw== MIME-Version: 1.0 In-Reply-To: <1353805621.95002.YahooMailNeo@web140001.mail.bf1.yahoo.com> References: <1353805621.95002.YahooMailNeo@web140001.mail.bf1.yahoo.com> Date: Sat, 24 Nov 2012 18:42:06 -0800 Message-ID: Subject: Re: zsh will not run scripts as /bin/bash even with #!/bin/bash as the first line From: Kurtis Rader To: John Cc: "zsh-users@zsh.org" Content-Type: multipart/alternative; boundary=047d7b86f4b23e39fe04cf48c323 X-Gm-Message-State: ALoCoQks3YF0RAxpSj3rmdcvtmRWMJzPxhKw5gsUNmJcbRpd3G3yjHJ8VQ6jC0qLaATLGuB80GRDXQpj8LwyM0uYsrkHqSF+x1hBOoqbUuvPCNT0QJn5r0PEru7734z+M1Obvnr02vu8l3FwsJB6gUFEDDcKLLJ9Vw== --047d7b86f4b23e39fe04cf48c323 Content-Type: text/plain; charset=UTF-8 The shell, whether zsh or bash, does not pay any attention to the shebang line. That is done by the operating system kernel. That is, when you execute a shell script the OS notices that the file is a plain text file with a "#!" signature and launches the named program to interpret its contents. You cannot reasonably expect exported functions to work across different shells. Put the function in a script file and reference that as your argument to the parallel command. On Sat, Nov 24, 2012 at 5:07 PM, John wrote: > Been using zsh for a while now and loving it. I ran into a problem today. > The following script errors out if run with zsh as my default shell: > > #!/bin/bash > v_build() { > > echo "The file is $1" > } > > export -f v_build > find . -maxdepth 1 -type f | parallel v_build > > Output: > % ./test > zsh:1: command not found: v_build > zsh:1: command not found: v_build > zsh:1: command not found: v_build > zsh:1: command not found: v_build > > If I switch to a user who has bash as its default shell, the same script > runs just fine: > > $ ./test > The file is ./test > The file is ./01.jpg > The file is ./02.jpg > The file is ./03.jpg > > Love to understand what I have incorrectly configured. It seems like zsh > is ignoring the shebang telling it to use /bin/bash as the shell to run the > script. > -- Kurtis Rader Caretake of the exceptional canines Junior and Chino --047d7b86f4b23e39fe04cf48c323--