[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Using single quotes to escape a newline
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] Using single quotes to escape a newline |
Date: |
Thu, 2 Jul 2015 08:04:33 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Wed, Jul 01, 2015 at 05:28:09PM -0700, Michael Convey wrote:
> ???I'm simply trying to wrap a long command, in which I choose points at
> which it wraps, and have it appear to the command as if it were all on one
> line. It sounds like the only way to do this is with \ at the end of each
> line, right????
If you want to break it up at arbitrary points, yes. That is what the
trailing \ is for.
rsync --some-option --another-option --yet-more-options="here and there" \
--and --so --on
If you let it break at natural points like | and && and || then you don't
need the \ .
foo bar |
quux baz |
awk 'blah'
try --to --do --something --with --a --lot --of --arguments ||
die "it didn't work"
If you're trying to write a very long STRING instead of a very long COMMAND
then it's totally different, and I would have to see what string you are
trying to write.
Re: [Help-bash] Using single quotes to escape a newline, Stephane Chazelas, 2015/07/01