I was wondering why my code doesn't read a variable when using if statement as follows:
this will work and prints b999 into users.txt file
BUT
wont work and it will prints empty line into users.txt if b999 does not exists! it should print b999 into the file if doesn't exists and if exists it will exit safely.
any idea why the line print ACTULOG "$user\n"; isn't possible to read the $user variable?
Hello:
I have the following perl script which is giving me trouble inside the second elsif statement. The purpose of the script is to go through a file and print out only those lines which contain pertinent information. The tricky part came when I realized that certain items actually spanned... (5 Replies)
Hello and thank you in advance.
I have a perl script that will basically copy files out of a directory , creat a new current date stamped dir and move them that current time stamped dir and append the file names with current time stamp.
I need to add line(s) that this is only run if FileX... (1 Reply)
Sorry for the newbie question
I need to create a perl script to check the modifed time of a file I already have that part created but need help in creating a if statement that basicly will check to see if the modifed time is at least 2hrs older then the current time if the stament is true to... (2 Replies)
Hello all,
I'm trying to automate an if statement in my Perl script. The script opens an input file for reading, checks each line in the file for a particular substring, and if it finds the substring, writes it to an output file.
There are approximately 200 different input files. Each has... (3 Replies)
#!/usr/bin/perl
$output1 = "/home/log.txt"
$output2 = "/home/grep.txt"
#Statement1 creates an output file called log.txt.
#Statement2 greps a line from log.txt and store the result in grep.txt
I want to create a condition where if the file grep.txt is empty repeat process.
Thanks. (1 Reply)
I'm just having a bit of trouble running this code. It tells me that there's a syntax error on line 29. Any help appreciated.
#!/usr/bin/perl
#
# Phone Book Application
#
%phonebook = (
"Wayne", '34687368',
"Home", '378643287',
"Work", '017374637',
"School",... (2 Replies)
Hi All,
I am writing a perl script where I take 2 variables from the user as STDIN to scan the lines of a file to produce as output.
How can I do an IF loop to test this for example in the mock file
12 10
35 20
37 5
45 12if I take user input as 40 and 10, how can I get the output lines in... (3 Replies)
can someone help me how to interpret this line?
my ($class, $hashref) = @_;
my $portfolio = {};
if ($hashref->{portfolio_id}) {
($portfolio) = GEmySQL->get ("select * from portfolio where portfolio.id=$hashref->{portfolio_id}");
}
===============
Question: how do... (2 Replies)
push @MACARRAY, "$+{catalog} $+{machine}\n" if ($info =~ /(?<catalog>catalog).+?(?<machine>\*+)/ms);
I am (still) trying to solve problem. Looking around on the server I found this piece of code. Specifically what does "$+{catalog} $+{machine}\n"
do ?
Thanks in advance (1 Reply)
Discussion started by: popeye
1 Replies
LEARN ABOUT LINUX
normality
normality(5) File Formats Manual normality(5)NAME
normality - definition of what types of normalities different users may have.
SYNOPSIS
/etc/normality
DESCRIPTION
The normality configuration file has a rather simple syntax, as shown in the diagram in the next section. Some things to remember is that
the normality file's influence is inversely proportional to the user's cluefulness and that, in certain cirumstances, modification of the
normality file can and will be considered immoral.
NORMALITY GRAMMAR
<normality file> := <normality file> <line> |
;
<line> := <normality type> ': ' <userlist> |
<normality type> '! ' <userlist> |
<normality type> '= ' <normality tags> |
<comment>
<normality type> := [A-Z][a-zA-Z0-9]+
<userlist> := <username> ', ' <userlist> ';0 |
<username> ';0
<normality tags> := <normality tag> ', ' <normality tags> ';0 |
<normality tag> ';0
<normality tag> := 'marriage' |
'love-relation' |
'nice-job' |
'money' |
'spare-time' |
'friends' |
'no-pager' |
'vacation'
<comment> := '#' .* '0
SEMANTICS
It is expected that you specify all normality types before you start assigning (or disassigning) users to (or from) them. That is so the
system can do an easier consistency check of the specification.
Let's say that we have a system with three normality types, foo, bar and gazonk and two users, cucumber and onion.
Now, a line like "foo! onion;" would exclude onion from having any of the real-life things specified by the foo type, even if that (or
those) things appear in another normality type. So, the disallow syntax overrides the allow syntax (specified by "<type>: <username>...").
There is always an implicit type named ``all'', that contains all normality tags.
For all system administrators, you have an implicit rule, "all! asr".
EXAMPLES
# Normality file for a sad system
# Our users are onion, cucumber, jdoe, jrl and washu
animetype= love-relation, nice-job, friends, spare-time;
notworst= love-relation, nice-job, friends;
sysadm= friends;
# All normality types we will use are declared
# Now let's do the magic stuff...
all: jdoe, jrl;
animetype: washu;
sysadm: cucumber;
all! onion;
# Now, this is fairly easy, OK?
WARNINGS AND BUGS
This file messes with the real world, so a bit of caution is recommended. Newer versions of the chastise(3) library function modifies this
file on-the-fly.
Has a tendecy to create small discontinuities in the velvet of reality whenever there are syntax errors in the normality file.
AUTHOR
This sick idea was put down in *roff format by Ingvar Mattsson, as a contribution to the alt.sysadmin.recovery man page collection.
4th Berkeley Distribution Release 0.001 alpha normality(5)