One of the missing routines is insert_every:
producing:
To see all of the dozens of missing textutil perl codes, visit the web page of Ondrej Bojar as noted in the script comments (verified as of today, Wed Feb 24 09:05:48 CST 2016).
I need to insert a file called temp_impact (which has about 15 lines in it) to a file called 11.23cfg starting at line 33. I searched the forums and found the
sed '34i\
test' 11.23cfg > newfile
That will enter word test at the appropriate line, but i need the entire file dumped there. Any... (4 Replies)
how to insert a extra line in a text file using a sh command
iam trying to think of a way to add a extra line but without deleting the whole text
do anyone have any ideas (2 Replies)
So I need to write lines into line X of file X.
I can get the file by doing:
cfgnumber=$(cat -n -comm.cfg| grep -i "servicegroup_name 24x7-comunicacions")
echo $cfgnumber
it outputs the Line where it finds now I need to start writing something right bellow that line.
thanks (10 Replies)
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)
sed '1r file.txt' <source.txt >desti.txt
This example will insert 'file.txt' between line 1 and 2 of source.txt.
sed '0r file.txt' <source.txt >desti.txt
gives an error message.
Does anyone know how 'sed' can insert 'file.txt' before the first line of source.txt? (18 Replies)
Hello,
I am trying to add a line (usually just a word) to some text files in a directory that are already sorted. I just don't want to run the sort command again because it can take a long time when the text or log files are really huge. I have a bashscript that will take in the 1st argument... (7 Replies)
Hi,
For my reuirement, I have to read a file from the 2nd line till the last line<EOF>.
Say,
I have a file as test.txt, which as a header record in the first line followed by records in rest of the lines.
for i in `cat test.txt`
{
echo $i
}
While doing the above loop, I have read... (5 Replies)
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
LEARN ABOUT DEBIAN
acme::brainfuck
Acme::Brainfuck(3) User Contributed Perl Documentation Acme::Brainfuck(3)NAME
Acme::Brainfuck - Embed Brainfuck in your perl code
SYNOPSIS
#!/usr/bin/env perl
use Acme::Brainfuck;
print 'Hello world!', chr ++++++++++. ;
DESCRIPTION
Brainfuck is about the tiniest Turing-complete programming language you can get. A language is Turing-complete if it can model the opera-
tions of a Turing machine--an abstract model of a computer defined by the British mathematician Alan Turing in 1936. A Turing machine con-
sists only of an endless sequence of memory cells and a pointer to one particular memory cell. Yet it is theoretically capable of perform-
ing any computation. With this module, you can embed Brainfuck instructions delimited by whitespace into your perl code. It will be trans-
lated into Perl as parsed. Brainfuck has just just 8 instructions (well more in this implementation, see "Extensions to ANSI Brainfuck"
below.) which are as follows
Instructions
+ Increment
Increase the value of the current memory cell by one.
- Decrement
Decrease the value of the current memory cell by one.
> Forward
Move the pointer to the next memory cell.
< Back
Move the pointer to the previous memory cell.
, Input
Read a byte from Standard Input and store it in the current memory cell.
. Output
Write the value of the current memory cell to standard output.
[ Loop
If the value of the current memory cell is 0, continue to the cell after the next ']'.
] Next
Go back to the last previous '['.
Extensions to ANSI Brainfuck
This implementation has extra instructions available. In order to avoid such terrible bloat, they are only available if you use the ver-
bose pragma like so:
use Acme::Brainfuck qw/verbose/;
The extra instructions are:
~ Reset
Resets the pointer to the first memory cell and clear all memory cells.
# Peek
Prints the values of the memory pointer and the current memory cell to STDERR. See also "Debugging" below.
Debugging
By using the debug pragma like this:
use Acme::Brainfuck qw/debug/;
you can dump out the generated perl code. (Caution: it is not pretty.) The key to understanding it is that the memory pointer is repre-
sented by $p, and the memory array by @m Therefore the value of the current memory cell is $m[$p].
RETURN VALUE
Each sequence of Brainfuck instructions becomes a Perl block and returns the value of the current memory cell.
EXAMPLES
JABH
#!/usr/bin/env perl
use Acme::Brainfuck;
print "Just another ";
++++++[>++++++++++++++++<-]>
++.--
>+++[<++++++>-]<.>[-]+++[<------>-]<
+.-
+++++++++.---------
++++++++++++++.--------------
++++++.------
>+++[<+++++++>-]<.>[-]+++[<------->-]<
+++.---
+++++++++++.-----------
print " hacker.
";
Countdown
#!/usr/bin/env perl
use strict;
use Acme::Brainfuck qw/verbose/;
print "Countdown commencing...
";
++++++++++[>+>+<<-]
>>+++++++++++++++++++++++++++++++++++++++++++++++<<
++++++++++[>>.-<.<-]
print "We have liftoff!
";
Reverse
#!/usr/bin/env perl
use Acme::Brainfuck qw/verbose/;
while(1)
{
print "Say something to Backwards Man and then press enter: ";
+[->,----------]<
print 'Backwards Man says, "';
[+++++++++++.<]<
print "" to you too.
";
~
}
Math
#!/usr/bin/env perl
use Acme::Brainfuck;
use strict;
use warnings;
my $answer = +++[>++++++<-]> ;
print "3 * 6 = $answer
";
VERSION
1.1.1 Apr 06, 2004
AUTHOR
Jaldhar H. Vyas E<lt>jaldhar@braincells.comE<gt>
THANKS
Urban Mueller - The inventor of Brainfuck.
Damian Conway - For twisting perl to hitherto unimaginable heights of weirdness.
Marco Nippula <http://www.hut.fi/~mnippula/> - Some code in this module comes from his brainfuck.pl
Mr. Rock - Who has a nice Brainfuck tutorial at <http://www.cydathria.com/bf/>. Some of the example code comes from there.
COPYRIGHT AND LICENSE
Copyright (c) 2004, Consolidated Braincells Inc.
Licensed with no warranties under the Crowley Public License:
"Do what thou wilt shall be the whole of the license."
perl v5.8.3 2004-04-06 Acme::Brainfuck(3)