...
How can I take a datafile that has a special character and have mult arrays. First array catches everything before the special character “$” and the second array catches everything after the special character?
Abc is good for me $4.55
Def might not be enough $5.66
Ghi price to play $6.77
I have to add a variable value to an array, something like this:
......
@my_array_name = $value_of_this_variable;
This doesnt seem to work, any ideas why?
Thanks! (4 Replies)
I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows:
$count = 0;
while ( $count < $#test )
{
`sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`;
`cat 0 >... (2 Replies)
Hi,
Is there an easy way to simulate following Perl code in Bash.
if ( grep {$my_value eq $_} @ARGV ){
print "Do Something\n";
} else {
die "Invalid value";
} (0 Replies)
Hi,
I have 2 arrays:
@names=qw(amith veena chaitra);
@files=qw(file.txt file1.txt file3.txt);
There is one to one relationship between names and files.
There needs to be mapping created between names and files.
The output should be like this:
amith --> file.txt
veena --->... (3 Replies)
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
Hi,
i want to search and replace array values by using perl
perl -pi -e "s/${d$i]}/${b$j]}" *.xml
i am using while loop for the same. if i excute this,it shows "Substitution replacement not terminated at -e line 1.".
please tell me what's wrong this line (1 Reply)
Hi all,
I have written a perl code and stored the data into Data structure using Data::Dumper module.
But not sure how to retreive the data from the Data::Dumper.
Eg.
Based on the key value( Here CRYPTO-6-IKMP_MODE_FAILURE I should be able to access the internal hash elements(keys) ... (1 Reply)
I'm trying to exlude a list of values with perl to process while reading in a file. Is there a way to use the next if with a list?
Example:
@array = qw(val1 val2 val3 val6);
while (<>) {
next if $_ =~ @array; # values I don't want to process here
print; # process the rest here
}... (8 Replies)
Discussion started by: timj123
8 Replies
LEARN ABOUT NETBSD
pac
PAC(8) BSD System Manager's Manual PAC(8)NAME
pac -- printer/plotter accounting information
SYNOPSIS
pac [-cmrs] [-P printer] [-p price] [name ...]
DESCRIPTION
pac reads the printer/plotter accounting files, accumulating the number of pages (the usual case) or feet (for raster devices) of paper con-
sumed by each user, and printing out how much each user consumed in pages or feet and dollars.
Options and operands available:
-Pprinter Accounting is done for the named printer. Normally, accounting is done for the default printer (site dependent) or the value of
the environment variable PRINTER is used.
-c flag causes the output to be sorted by cost; usually the output is sorted alphabetically by name.
-m flag causes the host name to be ignored in the accounting file. This allows for a user on multiple machines to have all of his
printing charges grouped together.
-pprice The value price is used for the cost in dollars instead of the default value of 0.02 or the price specified in /etc/printcap.
-r Reverse the sorting order.
-s Accounting information is summarized on the summary accounting file; this summarization is necessary since on a busy system, the
accounting file can grow by several lines per day.
names Statistics are only printed for user(s) name; usually, statistics are printed for every user who has used any paper.
OUTPUT FORMAT
pac formats the output into simple table, using four columns - number of feets or pages (column "pages/feet"), how many copies were made
(column "runs"), total price for this print (column "price") and user login with host name (column "login" or "host name and login"). If
argument name was not used and hence pac is printing information for all users, a summary line with print totals (runs, pages, price) is
appended.
Note that pac on other system might print the price as price per copy.
FILES
/var/account/?acct raw accounting files
/var/account/?_sum summary accounting files
/etc/printcap printer capability data base
SEE ALSO printcap(5)HISTORY
The pac command appeared in 4.0BSD.
BUGS
The relationship between the computed price and reality is as yet unknown.
BSD June 6, 1993 BSD