Sponsored Content
Top Forums Shell Programming and Scripting insert predefine text in front and on a loop Post 302496110 by masayangbata on Saturday 12th of February 2011 09:43:27 AM
Old 02-12-2011
Data insert predefine text in front and on a loop

Hi Experts,

I wish to insert predefined text in front of every line and this needs to be in a loop because it is always expanding.

Before :
11111111
22222222
33333333
44444444

55555555
77777777
88888888
00000000

[...]

To be Inserted :
a=
b=
c=
d=

After :
a=11111111
b=22222222
c=33333333
d=44444444

a=55555555
b=77777777
c=88888888
d=00000000

[...]

I've been searching and trying but to no avail Smilie

Thank you in advance,
Bata
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

2. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

3. Shell Programming and Scripting

SED: Extracting text between first occurance of foo in front of bar

Suppose I have a text file that contains the tags <foo> and <bar>. The text file can have unlimted occurances of <foo> and <bar> and looks somthing like this: <foo> Some Text <foo> Some Text <bar> Some Text <foo> Some (1 Reply)
Discussion started by: ArterialTool
1 Replies

4. Shell Programming and Scripting

How to insert text after a block of text?

Input: fstab is a configuration file that contains information of all the partitions and storage devices in your computer. The file is located under /etc, so the full path to this file is /etc/fstab. The >>>>> characters would be replaced by some texts. For example if i run a... (5 Replies)
Discussion started by: cola
5 Replies

5. Solaris

SysV package creation, how to predefine DESTDIR

Hi Solaris experts How to predefine the DESTDIR in a Solaris package? Thanks (1 Reply)
Discussion started by: ./hari.sh
1 Replies

6. Shell Programming and Scripting

How do I insert text with sed ?

Hi I was wondering if anyone new of a solution to this problem? I need to copy a time stamp that is on a line of .text in a text file into multiple positions on the same line. I need to insert the time stamp on the same line between every occurance of the text ".pdf_.html" right after the... (9 Replies)
Discussion started by: Paul Walker
9 Replies

7. Shell Programming and Scripting

Insert comments in a loop

I got an output file where I have insert some comments inbetween e.g. My file looks like this--- userA 10.120.xxx.xxx Jan 21 01:00 03:00 userA1 userB 10.120.xxx.xxx Jul 03 10:00 13:00 userB1 userC 10.120.xxx.xxx Aug 04 14:00 21:00 userC1 I Would like to... (4 Replies)
Discussion started by: Nagesh_1985
4 Replies

8. Shell Programming and Scripting

Add text in front of variable

I am just trying to add specific text in front of a ${variant} but can not seem to get the syntax correct. I have tried sed -i '$a NM_004004.5' ${variant} and printf "NM_004004.5:%s\n" ${variant} with no luck. Thank you :). (7 Replies)
Discussion started by: cmccabe
7 Replies

9. Shell Programming and Scripting

Insert a single quote in front of a line in vi editor

Hello Gurus, I wanted to put a single quote in every where starting with /oradata, and at the end with .dbf. For example I have one line as below: alter database rename datafile /oradata/test.dbf to /oradata_new/test.dbf I wanted as below alter database rename datafile '/oradata/test.dbf' to... (3 Replies)
Discussion started by: pokhraj_d
3 Replies

10. Shell Programming and Scripting

[sed]: syntax to insert N spaces in front of a string

Dear all, I would like to insert N blankspaces in front of a string using sed command To give an example (N=10), I tried that code: $ echo "abcd" | sed 's/^/ \{10,\}&/' but I failed, by obtaining that result: {10,}abcd Any help would be greatly appreciated, Thanks in advance,... (18 Replies)
Discussion started by: dae
18 Replies
IPSEC_KLIPSDEBUG(5)						  [FIXME: manual]					       IPSEC_KLIPSDEBUG(5)

NAME
ipsec_klipsdebug - list KLIPS (kernel IPSEC support) debug features and level SYNOPSIS
ipsec klipsdebug cat/proc/net/ipsec_klipsdebug DESCRIPTION
/proc/net/ipsec_klipsdebug lists flags that control various parts of the debugging output of KLIPS and MAST, two of the IPsec stacks supported by Libreswan. At this point it is a read-only file. A table entry consists of: + a KLIPS debug variable + a '=' separator for visual and automated parsing between the variable name and its current value + hexadecimal bitmap of variable's flags. The variable names roughly describe the scope of the debugging variable. Currently, no flags are documented or individually accessible yet except tunnel-xmit. The variable names are: tunnel tunnelling code netlink userspace communication code (obsolete) xform transform selection and manipulation code eroute eroute table manipulation code spi SA table manipulation code radij radij tree manipulation code esp encryptions transforms code ah authentication transforms code rcv receive code ipcomp ip compression transforms code verbose give even more information, beware this will probably trample the 4k kernel printk buffer giving inaccurate output All KLIPS debug output appears as kernel.info messages to syslogd(8). Most systems are set up to log these messages to /var/log/messages. EXAMPLES
debug_tunnel=00000010. debug_netlink=00000000. debug_xform=00000000. debug_eroute=00000000. debug_spi=00000000. debug_radij=00000000. debug_esp=00000000. debug_ah=00000000. debug_rcv=00000000. debug_pfkey=ffffffff. means that one tunnel flag has been set (tunnel-xmit), full pfkey sockets debugging has been set and everything else is not set. FILES
/proc/net/ipsec_klipsdebug, /usr/local/bin/ipsec SEE ALSO
ipsec(8), ipsec_manual(8), ipsec_tncfg(8), ipsec_eroute(8), ipsec_spi(8), ipsec_spigrp(8), ipsec_klipsdebug(5), ipsec_version(5), ipsec_pf_key(5) HISTORY
Written for the Linux FreeS/WAN project <http://www.freeswan.org/> by Richard Guy Briggs. [FIXME: source] 10/06/2010 IPSEC_KLIPSDEBUG(5)
All times are GMT -4. The time now is 02:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy