Problem in perl program in printing all the entries
Hi all,
I have a perl program where it checks for the presence of a particular line and prints the record if that line is present. But in the output file, all the entries are not being printed even if the entry has that line. The line to be matched is *FIELD* AV. The program which I wrote is given below. I have no idea where I might be wrong. Any suggestions are welcome. Thanks in advance.
Code:
#!/usr/bin/perl
$/="\n\n";
open(DATA,'mutationsonly.txt');
# or die("Could not open mutationsonly file.");
open(MYOUTPUT, ">newmutations.txt");
# or die ("could not open newmutations file.");
my @records= <DATA>;
close(MYOUTPUT);
close(DATA);
foreach my $record (@records)
{
chomp;
my $find=/^\*FIELD\*\sAV$/;
if ($record=~m/ $find /)
{
print "$record";
}
}
Hi Scripting Gurus, I am new bee in perl, and trying to write a script which must print the free disk space availability of C and E drives. Please advice.
Here is the script snippet and expected output:
#!/usr/bin/perl
use CGI qw/:html3 :standard/;
$spaceuselog =... (4 Replies)
I have a perl program that uses the mail program to send emails. It works fine but because I want to change the return address on the emails to be different I need to use mailx with the "-r" option. the problem is when I change this line to use mailx I no longer recieve "any" emails.
This works... (1 Reply)
Hey Guys,
I have some weird problem with printing scalars ...
When I'm executing script both are printing in terminal ...
But only one is printed to the file ?
I don't know whats going on .. :)
Btw .. I'm noobie :) took me lots of time to put this simple script together :)
Thank you... (3 Replies)
Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Hey guys i am using perl and trying to pull a list of books from a database and then populate the list in a separate TT2 file. When the list is generated there should be 39 book names. When I do the foreach statement in my tt2 below, the first statement gives me 39 Array(random number) and the... (1 Reply)
I got multiple of documents in which i have to extract a line coming after a ID..The scenario is
Customer ID: none
VT : 002/89
Customer ID: Yes
VT: 001/89
Customer ID: none
VT: 006/85
Customer ID: Yes
VT: 003/56
I have to extract the id which is coming after YES..The output... (7 Replies)
HI
I am trying to create a bash script to print whatever i type in
It has to have these below to define the size of the label and what size to print the text
N
q609
A100,10,0,5,2,2,N," "
P1
It has to be sent to below
> /dev/usblp0
So what it has to be is
Written... (12 Replies)
Hi
I have a file with number of entries
name 1 123
name 1 345
name 1 65346
name2 3243
name2 24234
name 2 234234
so on .........
how to count total number of entries for name 1 and name2...and so on Please guide. (1 Reply)
I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade.
I have:
if ( $response =~ m/^/ ) {
$user_wants_to_quit... (1 Reply)
Discussion started by: germany1517
1 Replies
LEARN ABOUT OSX
kerberosautoconfig
kerberosautoconfig(8) BSD System Manager's Manual kerberosautoconfig(8)NAME
kerberosautoconfig -- Kerberos -- Open Directory Single Sign On
SYNOPSIS
kerberosautoconfig [-f directory_node] [-o output_dir] [-r realm_name -m master_kdc] [-u] [-k] [-v debug_level]
DESCRIPTION
The kerberosautoconfig command creates / updates & removes the edu.mit.Kerberos file and the Kerberos:<REALM_NAME> config record in dslocal
db from information stored in the Open Directory config record named KerberosClient. The existing edu.mit.Kerberos file is only replaced if
the autogenerated header is present and the generation_id in the KerberosClient config record is greater than that within the file. The
default location of the output file is /Library/Preferences/edu.mit.Kerberos. If the machine is standalone, this command will do nothing
(unless the -u option is used).
Definitions:
directory_node
An open directory node path specifier. Such as /LDAPv3/127.0.0.1
output_dir
The directory in which kerberosautoconfig deposits the edu.mit.Kerberos file
realm_name
Name of the Kerberos realm that will be the default when creating a file from scratch
master_kdc
Host name of the master KDC for the default realm when creating a file from scratch
debug_level
Specifies the amount of debugging information printed to stdout, default is 1
Flags:
-f Tells kerberosautoconfig to look in the specified open directory node for the KerberosClient config record.
-o Specifies the directory in which kerberosautoconfig will write the new edu.mit.Kerberos file into
-r kerberosautoconfig can create an edu.mit.Kerberos file from information passed on the command line. Use the -r and -m flags to spec-
ify the default realm and master KDC for that realm.
-m See above
-k Adds the default Kerberos logging directives to the config file (useful when setting up a kdc)
-u Forces an update of the file. Will overwrite an existing non-autogenerated edu.mit.Kerberos file. Use with caution.
-v Specifies the amount of debugging information printed to stdout, default is 1
FILES
/Library/Preferences/edu.mit.Kerberos The main Kerberos config file (also known as krb5.conf on other systems)
SEE ALSO DirectoryService(1), Kerberos(1), kdcsetup(8), krb5.conf(5)BUGS
kerberosautoconfig looks for the KerberosClient config record in each of the open directory nodes on the search path. It merges the realm
information from any KerberosClient config records it finds, but it only checks the generation_id from the first config record found. This
means that the file does not get updated if the second KerberosClient record found changes.
HISTORY
kerberosautoconfig first appeared in Mac OS X 10.3
Darwin June 2, 2019 Darwin