From owner-freebsd-questions@FreeBSD.ORG Sun May 30 06:10:40 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32EC01065675 for ; Sun, 30 May 2010 06:10:40 +0000 (UTC) (envelope-from aiza21@comclark.com) Received: from avmxsmtp1.comclark.com (avmxsmtp1.comclark.com [202.69.191.115]) by mx1.freebsd.org (Postfix) with ESMTP id B516F8FC17 for ; Sun, 30 May 2010 06:10:39 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai4WAI+eAUzKRa1aPGdsb2JhbAAHh2GWXwEBAQE1vE2FFgSDRg X-IronPort-AV: E=Sophos;i="4.53,327,1272816000"; d="scan'208";a="1005223" Received: from unknown (HELO [10.0.10.3]) ([202.69.173.90]) by avmxsmtp4.comclark.com with ESMTP; 30 May 2010 14:10:38 +0800 Message-ID: <4C02015C.5070605@comclark.com> Date: Sun, 30 May 2010 14:10:36 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Dan Nelson References: <4C01F419.10100@comclark.com> <20100530053935.GG8866@dan.emsphone.com> In-Reply-To: <20100530053935.GG8866@dan.emsphone.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "questions@freebsd.org" Subject: Re: sh script writing help 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: Sun, 30 May 2010 06:10:40 -0000 Dan Nelson wrote: > In the last episode (May 30), Aiza said: >> In a .sh type script I have && exerr " very long message gt 250 char" >> all on the same line. This is a real pain to edit. >> >> Is there some code a can use to continue this on the next line so I can >> see it on the screen and still have the command function? I tried \ with >> no luck. > > \ should work just fine: > > $ echo "long line \ > split onto two" > long line split onto two > $ > You example works only because the continuation starts at position 1. $ [ -n "${test-name-fowarding}" -o -n "${test-noname}" ] || \ exerr "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" this is for ease of reading the code but will display with a bunch of spaces in the middle of the sentence. The \ works fine bypassing all white space between code not so for white space between the " ". Is there a coding method to get around this?