awk to get lowest & store value from another file...
I have two files. One small stores and one with large stores like below...
Small-stores.txt
Large-stores.txt
what i want to do is that, i want to transfer the excess stocks i have from small stores to large stores.
expected output...
To make it clear...
1. I want to get the biggest excess stock from small-stores.txt file and transfer it to smallest excess stocks in large-store.txt file. I can go up to positive 10 in excess stock in large-stores.txt file and minimize the excess stocks in small-stores.txt file to zero.
I need to get a section of a file based on 2 params. I want the part of the file between param 1 & 2. I have tried a bunch of ways and just can't seem to get it right. Can someone please help me out.....its much appreciated. Here is what I have found that looks like what I want....but doesn't... (12 Replies)
Hello,
I have three files in a directory:
1_700_123456.lst
1_701_123456.lst
1_702_123456.lst
I am trying to use a command via ksh that will list the file that has the lowest number in the second node and put that to a file.
In the example above, it would put 1_700_123456.lst... (2 Replies)
Hi all,
I have a question. I have a folder. I want to find the list of files that are modified today and store all those file names in a variable as comma separated values. I thought of using
"find . -mtime 0" command to find the list of files modified today. Also to get those values of file... (10 Replies)
I'm writing a KSH script that will get a file on the command line (such as input.txt), and in this file there is on number per line. The program needs to take the file, read each and determine the lowest number in the file. I currently have a while loop setup that will correctly out put every... (8 Replies)
I have large number of data files, close to 300 files, lets say all files are same kind and have extension .dat , each file have mulitple lines in it.
There is a unique line in each file containing string 'SERVER'. Right after this line there is another line which contain a string 'DIGIT=0',... (4 Replies)
Hi,
I need to parse a simple text file like below and store the word that starts with BR* to a variable say $BRno. I need to do this in sh script.
NOTE: the length of the numbers following BR is in constant. And there is only 1 BRXXX in a file at a given time.
.txt file:
BR276828... (1 Reply)
Hi,
TASK 1:
I have been using this code to print the information of files kept at "/castor/cern.ch/user/s/sudha/forPooja" in some text file name FILE.txt.
rfdir /castor/cern.ch/user/s/sudha/forPooja | grep data | awk '{print "rfio:///castor/cern.ch/user/s/sudha/forPooja/"$9}' > FILE.txt
... (6 Replies)
i am having a problem finding the lowest number after punching in a bunch of numbers in the .txt file but its probably the way i have the code set up.
help please! (4 Replies)
Hi again!
I am still impressed how fast I get a solution for my topic "average specific column value awk" yesterday.
The associative arrays in awk work fine for me!
But now I have another question for the same project.
Now I have a list like this
1 -0.1
1 0
1 0.1
2 0
2 0.2
2 -0.2
How... (10 Replies)
I have two files which are the output of a multiple choice vocab test (60 separate questions) from 104 people (there are some missing responses) and the question list. I have the item list in one file (File1)
Item,Stimulus,Choice1,Choice2,Choice3,Choice4,Correct... (5 Replies)
Discussion started by: samonl
5 Replies
LEARN ABOUT DEBIAN
catalyst::authentication::store
Catalyst::Authentication::Store(3pm) User Contributed Perl Documentation Catalyst::Authentication::Store(3pm)NAME
Catalyst::Authentication::Store - All about authentication stores
MULTIPLE BACKENDS
NOTE This is documentation for the old store system used in versions of Catalyst::Plugin::Authentication prior to 0.10. This is NOT how
the new realm-based stores work. This is here for reference only.
See Catalyst::Plugin::Authentication::Internals instead.
OLD STORE DOCUMENTATION BELOW
A key issue to understand about authentication stores is that there are potentially many of them. Each one is registered into the
application, and has a name.
For most applications, there is only one, and in this framework it is called 'default'.
When you use a plugin, like
use Catalyst qw/
Authentication
Authentication::Store::Foo
/;
the Store plugins typically only act at setup time. They rarely do more than check out the configuration, and register e.g. Store::Foo, and
set it as the default store.
__PACKAGE__->default_auth_store( $store );
# the same as
__PACKAGE__->register_auth_stores( default => $store );
WORKING WITH USERS
All credential verifiers should accept either a user object, or a user ID.
If a user ID is provided, then they will fetch the user object from the default store, and check against it.
This should be pretty much DWIM all the time.
When you need multiple authentication backends per application then you must fetch things yourself. For example:
my $user = $c->get_auth_store("other_store")->get_user($id);
$c->login( $user, $supplied_password );
Instead of just:
$c->login( $id, $supplied_password );
which will go to the default store.
WRITING A BACKEND
Writing an authentication storage backend is a very simple matter.
The only method you really need to support is "get_user".
This method should accept an arbitrary list of parameters (determined by you or the credential verifyer), and return an object inheriting
Catalyst::Authentication::User.
For introspection purposes you can also define the "user_supports" method. See below for optional features. This is not necessary, but
might be in the future.
Integrating with Catalyst::Plugin::Session
If your users support sessions, your store should also define the "from_session" method. When the user object is saved in the session the
"for_session" method is called, and that is used as the value in the session (typically a user id). The store is also saved in the hash. If
"$user->store" returns something registered, that store's name is used. If not, the user's class is used as if it were a store (and must
also support "from_session").
Optional Features
Each user has the "supports" method. For example:
$user->supports(qw/password clear/);
should return a true value if this specific user has a clear text password.
This is on a per user (not necessarily a per store) basis. To make assumptions about the store as a whole,
$store->user_supports(qw/password clear/);
is supposed to be the lowest common denominator.
The standardization of these values is to be goverened by the community, typically defined by the credential verification plugins.
Stores implying certain credentials
Sometimes a store is agnostic to the credentials (DB storage, for example), but sometimes it isn't (like an Htpasswd file).
If you are writing a backend that wraps around a module, like Catalyst::Authentication::Store::Htpasswd wraps around Authen::Htpasswd, it
makes sense to delegate the credential checks.
This particular example caused the following "feature" to be added:
$user->supports(qw/password self_check/);
Writing a plugin to go with the backend
Typically the backend will do the heavy lifting, by registering a store.
These plugins should look something like this:
sub setup {
my $c = shift;
$c->default_auth_store(
# a store can be an object or a class
Catalyst::Authentication::Store::Foo::Backend->new(
...
)
);
$c->NEXT::setup(@_);
}
perl v5.14.2 2012-04-14 Catalyst::Authentication::Store(3pm)