Date: Mon, 18 May 2015 14:31:16 +0100 From: Matthew Seaman <matthew@FreeBSD.org> To: freebsd-questions@freebsd.org Subject: Re: Problem with sed Message-ID: <5559E9A4.409@FreeBSD.org> In-Reply-To: <20150518090051.6600f32a@seibercom.net> References: <20150518090051.6600f32a@seibercom.net>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --O9NjIEtDsh0W6bh16nqJxlwAe9qsFkQ3c Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2015/05/18 14:00, Jerry wrote: > I rarely use sed, so I admit to not being fully acquainted with its > idiosyncrasies,; however, this one is really annoying. >=20 > I am using this command in an attempt to remove empty lines: >=20 > $ sed -i /^$/d /var/tmp/myfile.txt >=20 > and get this error: >=20 > sed: 1: "/var/tmp/myfile.txt": undefined label 'mp/myfile.txt' >=20 > I don't understand why. I am following the example I found in the "sed = & awk" handbook by "O'Reilly" >=20 sed -i.bak -e '/^$/d' /var/tmp/myfile.txt You're getting sed(1) confused as to what is the extension for the backup of the file it creates, what the command you want to rn is and what the input filename is. Also, you need to put some characters of syntactic significance to the shell inside quote marks. Cheers, Matthew --O9NjIEtDsh0W6bh16nqJxlwAe9qsFkQ3c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org iQJ8BAEBCgBmBQJVWem0XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnJXQP/RykQUGX/Ri0tv7Zh02gZomB lE4jSJeGZ8rNxSwUU3jMdAOMzupvUa7kFXCc4n+4mdqmD18yMkDsjml/La/9qiC4 pnWxkf/dfq4L5eCPedLsjMAR6Xq8OMFeqTdpAG0yinEG4UkETOq3LT7cWjkqrqiR qBI+pouyx8ESZvL1enYM2eK3IhZgXS253RyRgeNPzA7ct36JRKH7BSGDoLfPl+VI roFmSM4GQUym00FrbRw4lwA80/MSB6sqfrh3OKSNy+P//1SogTrJmomTKUXlG2fO Jpsq/VYzgNLx7UU1UsjUBdrNGg2DnyNBKbNTUkfB3bt+OAuUz6WbgZK2lMCKSXPZ DBMVHHMkQUyt/ZKfTAmJYzK90oe8Mu5zhpUuNHW7kLC46Zdp4KAeajQRl0Ay02z7 mu88sC690+Wpzfpzx5ZZwxcVjE8fFnV342pzQQ/O1ERzhUW0dlCgfaRFjInkNSEq TUQIWAZvNPRnIdicNf6yzG5iepE5KuE+cLlODZmbTo2BmQwyoKsQ8FbWGD0Tckg2 w4RD/q4G7wnDzf9MZZ+AXYWls3NIFSMZvpvtoiELVwmYnJCEx30GHY6TZZ/ylDd3 7lBQK2BGWAlUE+uzGXs5p3YODwXtFYpE5U3Qxxz7ZiTMXYLyvIfxBXERDpZL/OQq PFZqiC6bdAye2IbPcDG8 =ZpAW -----END PGP SIGNATURE----- --O9NjIEtDsh0W6bh16nqJxlwAe9qsFkQ3c--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5559E9A4.409>