Re: [SLUG] Insert line in a file

From: thor_consulting@yahoo.com
Date: Thu Sep 18 2003 - 16:18:51 EDT


perl -pi.bak -e 'if ( $. == 20 ) { print ">>>>>>line 20\n" }' somefile.txt

thor

mailto:thor_consulting@yahoo.com
http://www.geocities.com/thor_consulting/
----- Original Message -----
From: "Rock" <mrock@stewartsigns.com>
To: <slug@nks.net>
Sent: Thursday, September 18, 2003 15:25
Subject: [SLUG] Insert line in a file

> How can I insert a line in a file at line number 20? Simply please. I
> really understand the straight forward explanations. My mind is just
> wired funny I guess. I am using all shell commands to do this file
> manipulation.
>
>
> Michael C. Rock
> Systems Analyst
> Registered Linux User # 287973
>
> "The time has come the walrus said to speak of many things,,"
> "Christians give up what they cannot keep to gain what they cannot lose"
>
>
>
>
> -----------------------------------------------------------------------
> This list is provided as an unmoderated internet service by Networked
> Knowledge Systems (NKS). Views and opinions expressed in messages
> posted are those of the author and do not necessarily reflect the
> official policy or position of NKS or any of its employees.
>

-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:41:13 EDT