From mboxrd@z Thu Jan 1 00:00:00 1970 From: darren kirby Subject: Re: Inserting text in a specific file in a specific point Date: Tue, 13 Dec 2005 13:25:01 -0800 Message-ID: <200512131325.07720.bulliver@badcomputer.org> References: <439F34E2.3050004@tuxdoit.com> Reply-To: bulliver@badcomputer.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1289825.xB7RaateI0"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <439F34E2.3050004@tuxdoit.com> Sender: linux-admin-owner@vger.kernel.org List-Id: To: linux-admin@vger.kernel.org --nextPart1289825.xB7RaateI0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline quoth the MARG: > Hi, > > My .bash_profile is: > ---------------------- > # .bash_profile > > # Get the aliases and functions > if [ -f ~/.bashrc ]; then > . ~/.bashrc > fi > > # User specific environment and startup programs > > PATH=3D$PATH:$HOME/bin > > export PATH > unset USERNAME > ---------------------------- > > What i'd like to do is from the command prompt or a bash script, insert > text after the line "PATH=3D$PATH:$HOME/bin". > > I've searched the web and tried a few tricks, but one worked :( > > Could you help me please=20 sed is the tool you need. Try something like: sed -e '10a\some text\' .bash_profile > Wam Regards, > MARG =2Dd =2D-=20 darren kirby :: Part of the problem since 1976 :: http://badcomputer.org "...the number of UNIX installations has grown to 10, with more expected..." =2D Dennis Ritchie and Ken Thompson, June 1972 --nextPart1289825.xB7RaateI0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBDnzwzwPD5Cr/3CJgRArUaAJ9QZIQ7hHpO9rl9Y4nhT20+CgRHNwCglxT/ WnZswcZKXxSxX3JOGmb8Mtk= =zEdR -----END PGP SIGNATURE----- --nextPart1289825.xB7RaateI0--