From owner-freebsd-questions@FreeBSD.ORG Thu Jan 26 04:52:17 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 079EC106567A for ; Thu, 26 Jan 2012 04:52:17 +0000 (UTC) (envelope-from vogelke@hcst.net) Received: from beta.hcst.com (beta.hcst.com [192.52.183.241]) by mx1.freebsd.org (Postfix) with ESMTP id C42948FC0C for ; Thu, 26 Jan 2012 04:52:16 +0000 (UTC) Received: from beta.hcst.com (localhost [127.0.0.1]) by beta.hcst.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q0Q4aMIb021608 for ; Wed, 25 Jan 2012 23:36:22 -0500 Received: (from vogelke@localhost) by beta.hcst.com (8.14.3/8.14.3/Submit) id q0Q4aM4G021607; Wed, 25 Jan 2012 23:36:22 -0500 Received: by kev.msw.wpafb.af.mil (Postfix, from userid 32768) id E9859BF90; Wed, 25 Jan 2012 23:35:52 -0500 (EST) To: freebsd-questions@freebsd.org In-reply-to: (doug@polands.org) Organization: Array Infotech X-Disclaimer: I don't speak for the USAF or Array Infotech. X-GPG-ID: 1024D/711752A0 2006-06-27 Karl Vogel X-GPG-Fingerprint: 56EB 6DBF 4224 C953 F417 CC99 4C7C 7D46 7117 52A0 References: Message-Id: <20120126043552.E9859BF90@kev.msw.wpafb.af.mil> Date: Wed, 25 Jan 2012 23:35:52 -0500 (EST) From: vogelke+unix@pobox.com (Karl Vogel) Subject: Re: Portability of shell scripts from other *nixes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vogelke+unix@pobox.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 04:52:17 -0000 >> On Wed, 25 Jan 2012 16:08:07 -0600, >> "Doug Poland" said: D> I'm trying port some shell scripts to FreeBSD that were originally D> written on Darwin (OS X). The issue I'm having is the shebang line of D> the scripts in OS X is #!/bin/sh, and it turns out that is really an D> instance of bash, and the code contains some bashisms. On FreeBSD I D> have bash in /usr/local/bin/bash. D> Is there an "easy/best" way to have a single shebang that works on both D> OS's? I'd rather not change FreeBSD's bourne shell to bash with any D> symlinking of /usr/local/bin/bash to /bin/sh. Do you have the Korn shell installed? I've found that to be a nice compromise for scripts that have bash-isms. -- Karl Vogel I don't speak for the USAF or my company Texted a friend meaning to ask if she was busy. Me: "Are you busty?" Her: "They're manageable, what's up?" --Jimmy Fallon, #textingdisaster tweets, 13 Jan 2012