I have a school project to create a shell program same as calendar i must create
a txt file with celebrations with vi i know this but the problem is i don't know awk
and grep.
The object of object is to create a program who read a date an appear the celebration.
Can you help me please !!!... (1 Reply)
I'm trying to take a list of domains, find out the MX resolve it to IP then find out what the NS is and output the contents to a new file.
The only problem i'm having is when checking the Ip or host of the MX i can only get it to print the column with the MX record and the results of the host... (1 Reply)
I am writing a script that ssh's out to our various servers and extracts diskspace info to generate into a report. With the mix of servers linux/solairs 8-10/AIX the easiest way is to use df -k (though I much rather prefer df -h).
I have pasted the relevant code:
dfdata=`ssh -q -o... (1 Reply)
Hello,
Please advise. Scoured this site, as well as google for answers. However if you do not know what to search for, it's a bit hard to find answers.
INPUT:
ACTASS=
802
BASECOS=
279
COSNCHG=
3
CUSCOS=
52
UPLDCOS=
2
DESIRED OUTPUT:
ACTASS=802
BASECOS=279 (13 Replies)
Hi,
I would like to know the awk command that gets the below o/p:
File contents:
Board1;9a;60;36;60.0;60;0;0.0
Board2;96;60;35;58.3;55;0;0.0
Board3;92;60;60;100.0;60;60;100.0
Used awk script:
#!/bin/awk -f
BEGIN {
FS = ";";
printf (" Device | ... (1 Reply)
Hoping for some assistance.
my source file consists of:
os, ip, username
win7, 123.56.78, john
win7, 123.56.78, paul
win7, 10.1.1.1, john
win7, 10.2.2.3, joe
I've been trying to run a script that will only return ip and username where the IP address is the same and the username is... (3 Replies)
---------- Post updated at 11:48 AM ---------- Previous update was at 11:46 AM ----------
Hello all
I have an awk code that successfully creates separate text files based on the first six letters of the second field. What it doesn't do is preserve the header into each resulting file.
... (6 Replies)
Hello there,
I am trying to get my head around the section below of a script we use that incorporates AWK and Regular Expressions.
{ match($0,"The broker*");print $1,$2,$3 ":", substr($0, RSTART,RLENGTH)}
I have a basic understanding of how match works, what I am struggling with is the... (2 Replies)
HI Folks -
I have a business need to check weather or not there are "active" sessions within a particular application I interact with prior to running any automation.
I have built a function that first exports all "sessions" from my respective application to a text file. The output is as... (2 Replies)
Hello all,
I have searched high and low for a solution to this, many have come really close but not quite what I'm after.
I have 2 files. One contains GUID's, for example:
8121E002-96FE-4C9C-BC5A-6AFF20DACECD
84468F30-F3B7-418B-81F0-0908E80792BF
A second file, contains a path to the... (8 Replies)
Discussion started by: tirmUK
8 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)