From owner-freebsd-questions@FreeBSD.ORG Fri Apr 28 16:34:24 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1675316A403 for ; Fri, 28 Apr 2006 16:34:24 +0000 (UTC) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.100.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE9D143D46 for ; Fri, 28 Apr 2006 16:34:23 +0000 (GMT) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (localhost.cis.okstate.edu [127.0.0.1]) by dc.cis.okstate.edu (8.12.6/8.12.6) with ESMTP id k3SGYNhn093282 for ; Fri, 28 Apr 2006 11:34:23 -0500 (CDT) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <200604281634.k3SGYNhn093282@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org Date: Fri, 28 Apr 2006 11:34:23 -0500 From: Martin McCormick Subject: Bourn Shell -n Flag Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2006 16:34:24 -0000 I read about the noexecute flag or -n flag which is supposed to check the syntax of a Bourn Shell script to see what it would do if run, but not actually do anything. This sounds like a wonderful thing, especially when one is going to run a dangerous script and you only get one chance to get it right. I tried sh -n scriptname and it always silently succeeds even if I type sh -x -n somescript. I even deliberately created a script with a syntax error in it and tried sh -x -n again. It still did nothing but exit. Does this just not work or am I misunderstanding the purpose of the flag? Thanks for your help. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group