From owner-freebsd-questions@FreeBSD.ORG Sun May 30 06:18:19 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 4B8C31065675 for ; Sun, 30 May 2010 06:18:19 +0000 (UTC) (envelope-from xkyanh@gmail.com) Received: from mail-pz0-f174.google.com (mail-pz0-f174.google.com [209.85.222.174]) by mx1.freebsd.org (Postfix) with ESMTP id 193228FC0A for ; Sun, 30 May 2010 06:18:18 +0000 (UTC) Received: by pzk4 with SMTP id 4so153758pzk.7 for ; Sat, 29 May 2010 23:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:organization:user-agent :x-operating-system:x-face:face:x-mailer:mime-version:content-type :content-transfer-encoding; bh=BmaC1vIZCEU9dI4cdF8+uq0hVNpvfFDCl7eFm2Opxbk=; b=WHC3wo8idBoj8COQcvT0cWfkJtsI1znlhrqP53c6YxuECjZzRrjcH/7C1gEj6CCLWJ X11taNspLrPdUV7r00IFScPvqzLGpPKoFJDkGj/v8LvbORJnwP0cSM8FiyJfecYqJkOx KwgJSeF1O2396OB/73JLDblQJxHslrto9UHh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:user-agent:x-operating-system:x-face:face:x-mailer :mime-version:content-type:content-transfer-encoding; b=ktQ6bwGR+E26owlun2auCbT0fnwZ+42Q1qYJ44btNCrWYXOpdk7iHhr8cGQKCZwtdk Fum8ZVDsQoKiBhR1SaCJauF786IrWHHbpQT4wzAAKWj06X8lsglZWyh4Mq15AUZVFwFH pOK99vuW2XZNAvWLopGJNSdhlJ6MI0poJ4Hg8= Received: by 10.141.214.40 with SMTP id r40mr1992763rvq.11.1275200298533; Sat, 29 May 2010 23:18:18 -0700 (PDT) Received: from icy.localdomain ([222.253.72.119]) by mx.google.com with ESMTPS id d14sm3428343rva.18.2010.05.29.23.18.15 (version=SSLv3 cipher=RC4-MD5); Sat, 29 May 2010 23:18:18 -0700 (PDT) Date: Sun, 30 May 2010 13:17:30 +0700 From: "Anh Ky Huynh" To: Aiza Message-ID: <20100530131730.1931dbd4@icy.localdomain> In-Reply-To: <4C02015C.5070605@comclark.com> References: <4C01F419.10100@comclark.com> <20100530053935.GG8866@dan.emsphone.com> <4C02015C.5070605@comclark.com> Organization: Vietnamese TeX Users Group User-Agent: FreeBSD X-Operating-System: FreeBSD X-Face: FreeBSD Face: FreeBSD X-Mailer: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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:18:19 -0000 On Sun, 30 May 2010 14:10:36 +0800 Aiza wrote: > 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? Do you try to read your expression from a file? exerr `cat /path/to/data` the contents of /path/to/data are your very long string. Regards, -- Anh Ky Huynh