Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 May 2010 07:07:13 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Fbsd1 <fbsd1@a1poweruser.com>
Cc:        "questions@freebsd.org" <questions@freebsd.org>
Subject:   Re: how to find literal in file and them delete that line
Message-ID:  <4BE7A291.6070109@infracaninophile.co.uk>
In-Reply-To: <4BE77FB1.2050607@a1poweruser.com>
References:  <4BE77FB1.2050607@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/05/2010 04:38:25, Fbsd1 wrote:
> I want to search every line in the specified file for a literal and if
> found then delete that line from the file and save the file all from
> within a sh type of shell script.
> 
> Does anyone have a example they would share with me?

grep -v 'literal' < file > file.new

	Cheers,

	Matthew

- -- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvnopEACgkQ8Mjk52CukIxlzgCfW1u7k0O1BZ5gCM5emVUfJJGk
80IAn100dDD01WMkTrXXE3NI88Ohd/ZK
=6nDd
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BE7A291.6070109>