From owner-freebsd-questions@FreeBSD.ORG Sun May 30 18:35:39 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 03B491065672 for ; Sun, 30 May 2010 18:35:39 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 70C4E8FC15 for ; Sun, 30 May 2010 18:35:37 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.2, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_50 0.80) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: o4UIZEVD016192 Received: from kobe.laptop (77.49.120.100.dsl.dyn.forthnet.gr [77.49.120.100]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.1) with ESMTP id o4UIZEVD016192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 30 May 2010 21:35:21 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.4/8.14.4) with ESMTP id o4UIZ952062379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 30 May 2010 21:35:09 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.4/8.14.4/Submit) id o4UIZ7m5062347; Sun, 30 May 2010 21:35:07 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Aiza References: <4C01F419.10100@comclark.com> Date: Sun, 30 May 2010 21:35:07 +0300 In-Reply-To: <4C01F419.10100@comclark.com> (Aiza's message of "Sun, 30 May 2010 13:14:01 +0800") Message-ID: <87wrul2q78.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 18:35:39 -0000 On Sun, 30 May 2010 13:14:01 +0800, Aiza wrote: > 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. If the message does not have to be a *single* command-line argument of the exerr function, you can split the message in multiple arguments and use '\' for continuation lines, e.g.: echo "This is a very long message" \ "that does not fit in a single" \ "line of text." This might not work if you _have_ to pass the string as a single argument, but even in that case you can use shell substitution to wrap the exerr() function, e.g.: exwrap() { return exerr "$*" } exwrap "This is a very long message" \ "that does not fit in a single" \ "line of text."