From mboxrd@z Thu Jan 1 00:00:00 1970 From: MARG Subject: Re: Inserting text in a specific file in a specific point Date: Tue, 13 Dec 2005 22:20:51 +0000 Message-ID: <439F4943.4050107@tuxdoit.com> References: <439F34E2.3050004@tuxdoit.com> <200512131325.07720.bulliver@badcomputer.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200512131325.07720.bulliver@badcomputer.org> Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: linux-admin@vger.kernel.org, bulliver@badcomputer.org Hi Darren, Thank you for your answer. I tried that already and it works. Problem is, it is assuming that the PATH line is line 10 and in other systems it may not be. Any ideas ? Warm Regards, MARG PS: Thank you Scott for the cool link. darren kirby wrote: > 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=$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=$PATH:$HOME/bin". >> >>I've searched the web and tried a few tricks, but one worked :( >> >>Could you help me please > > > sed is the tool you need. > > Try something like: > > sed -e '10a\some text\' .bash_profile > > >>Wam Regards, >>MARG > > > -d >