From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1647 invoked by alias); 27 Jun 2011 14:56:46 -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: 16106 Received: (qmail 25114 invoked from network); 27 Jun 2011 14:56:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.210.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:subject:to:x-priority:message-id :mime-version:content-type:content-transfer-encoding:x-mailer; bh=xnQc9vGG6Q8XNx6eqydwz+TABZJS8HkcNybeemtVP4I=; b=bR6AdaKhbXw0gCXiMAeZCUBRJIHQ25TsCZZwzxGVW/PVsy3jYBC9UrX3HWxMbrAIg7 N7TxqmvZEzRvKpT3qNm2Bur210fII8F8UBcye+TyVX0M832si/8VQQYjAHZt4CrB9iMn g48H3/PX+VhUIMUL2JJ2angDleK3AO+TQS6Pg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:subject:to:x-priority:message-id:mime-version :content-type:content-transfer-encoding:x-mailer; b=wp1kfnNPOsdgl6xtgslNRPPdHHfJwoFLpDgOl7eUWiPdTTR3SpxvalV+SXauiFTm7H 28rSUlwdYFQkzX4QhRmAE6Fira4YCYSTA+SRTWiD17ydxFyyZ3bt/a8DOIBmD+BVKJu9 SuC60e36Yp2U0KTIydwvTKYlkCX3Vk5v3OfjY= Date: Mon, 27 Jun 2011 10:56:35 -0400 From: TJ Luoma Subject: Shell scripting with zsh with unknown path To: Zsh Users X-Priority: 3 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailer: Mailsmith 2.3.1 (422) I have always written my shell scripts in #!/bin/sh or=20 #!/bin/bash but there are times when I find that I would really=20 prefer to use zsh. Ideally I'd like to be able to write all of my scripts in zsh so=20 I don't have to keep two syntax/feature sets in my head. The problem is that I don't always know where zsh will be=20 installed. It could be /usr/bin/zsh or /usr/local/bin/zsh or /bin/zsh. I have seen perl scripts which have used #!/usr/bin/env perl but that did not seem to work for zsh. TjL