From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21156 invoked by alias); 25 Nov 2012 02:47:02 -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: 17428 Received: (qmail 302 invoked from network); 25 Nov 2012 02:46:51 -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=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.223.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=MxIANRVHqeKq47M705LJUjcqrMhEmIbDkTEE9wlBdTQ=; b=M5nLz/zkm5n+YKUMjs3J2nIrhcroJDq+Arnp8L3qHAc8gCiikVhrqe4CPDbLOHj9tz FRRGzmCs+PxO0pfnMu501CC922OqLLS+kUltAC30j/ddrvXUYNidPdeQgfCTxiMVs+Us fZtFzlGr941w4eSh7itGnp4nH334ncdoeleXsuE4T17ZN8Y6LRRX12nuF9RuLubJtgdE 7aDtaT3wD38z/R7nSjhcQBDuHHq4zRmt0Np17YwxOF7maAQtJZLTtTJ+DGrsHvA36gLt dNfaMTz46TdnJUrMs3gGY1HzRjeSX0j0tQuFTrjkEZhhFZAYQrLSPYWnAvMUNyVb82+N 99NA== MIME-Version: 1.0 In-Reply-To: <1353805621.95002.YahooMailNeo@web140001.mail.bf1.yahoo.com> References: <1353805621.95002.YahooMailNeo@web140001.mail.bf1.yahoo.com> From: Yichao Yu Date: Sat, 24 Nov 2012 21:41:13 -0500 Message-ID: Subject: Re: zsh will not run scripts as /bin/bash even with #!/bin/bash as the first line To: John Cc: "zsh-users@zsh.org" Content-Type: text/plain; charset=ISO-8859-1 On Sat, Nov 24, 2012 at 8: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 Ur main script is indeed run by bash but parallel is trying to execute the v_build command in your default shell.... therefore it has nothing to do with the #! line... Not sure how to solve this problem though.... > > 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.