Sponsored Content
Top Forums Shell Programming and Scripting How do I go about finding a value located in one file in another? Post 302258033 by mojoman on Thursday 13th of November 2008 05:07:41 PM
Old 11-13-2008
How do I go about finding a value located in one file in another?

Hi,

I have to determine which VALID users made a failed loggon attempts on our server.To make a long story short, I have isolated the list of all the usernames and number of attempts in one file, and have isolated the valid users who have made failed loggon attempts in another file. I now have to tell my script to match the valid users who have made failed loggon attempts to the entries that contain ALL users who made failed failed loggon attempts and the number of attempts. I was thinking of reading the file with valid users, reading line by line and grepping the username in the file that contains the failed usernames with number of attempts. I am new to shell scropting so I am not sure how to code this. Could someone provide an example please or suggest a better way to do what I want?

So if I have MARK in file 1 I need to match it with MARK 2 in file 2 and then output MARK 2 to another file. 2 being the # of failed loggon attempt.

Thanks,

Thanks,

Mohit

Last edited by mojoman; 11-13-2008 at 06:17 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

Where Xorg X-Lock file is located in Solaris?

I am using Xorg server with Solaris 10. After unnormal poweroff dtlogin tells: "The X-server can not be started on display :0" I am absolutelly sure it is because there is still a X-lock file from the previouse X-session somewhere, but I do not know where is it located in Solaris! :confused: (2 Replies)
Discussion started by: eugrus
2 Replies

2. Shell Programming and Scripting

Pls Help - Need to edit file located in several directories

I need to update an entry called "mail.RiskNavigatorFromEmailAddress" in all of the "Application.properties" files below, which are located in several different directories... Each of these Application.properties files has the following entry: ... (3 Replies)
Discussion started by: kthatch
3 Replies

3. UNIX for Dummies Questions & Answers

Deleting a file located on another server

Hi, I have successfully copied a file from one server to another using following command. user1@server1# scp test.jsp user2@server2:/home/ Now i want to delete that copied file(test.jsp) from "server2" by running some command from server1. Please help... (1 Reply)
Discussion started by: SanketJOSHI
1 Replies

4. Shell Programming and Scripting

Deleting a file located on another server

Hi, I have successfully copied a file from one server to another using following command. user1@server1# scp test.jsp user2@server2:/home/ Now i want to delete that copied file(test.jsp) from "server2" by running some command from server1. Please help... (2 Replies)
Discussion started by: SanketJOSHI
2 Replies

5. Shell Programming and Scripting

use awk to read randomly located columns in an excel file

Hi, I have an excel file that have a random count of columns/fields and what im trying to do is to only retrieve all the rows under 2 specific field headers. I can use the usually command for awk which is awk 'print{ $1 $2}' > output.txt, but the location of the 2 specific field headers is... (9 Replies)
Discussion started by: mdap
9 Replies

6. UNIX for Dummies Questions & Answers

how to know the device on which the file is located

Hi, i want to know on which device a file is located is there any command or anyway to know it thanks santosh (5 Replies)
Discussion started by: santosh149
5 Replies

7. Shell Programming and Scripting

Executing KSH batch file located in specific folder

Ok apologies if this is trivial or doesn't make sense but I am quite new to korn shells; So I have a .ksh batch file located in a folder of my choosing, I want to run this file in a korn shell. The problem though is that I want to get VBA code to do this. I have (VBA) code which opens command... (1 Reply)
Discussion started by: cjsewell
1 Replies

8. UNIX for Advanced & Expert Users

Need help to change the content for remote located file

Hi All, I have one file that sits on 4 diffrent servers, those servers are diffrent region based and they are authentication protected and that file has a diff port numbers, so when run the script it must ask my login details,region of server and port no for that file once it took from me... (1 Reply)
Discussion started by: tmarjuna
1 Replies

9. Shell Programming and Scripting

Need help to change the content for remote located file

Hi All, I have a file that sits on 4 diffrent servers, those servers are diffrent region based and they are authentication protected and that file has a diff port numbers, so when run the script it must ask my login details,region of server and port no for that file once it took from me it... (1 Reply)
Discussion started by: tmarjuna
1 Replies

10. UNIX for Dummies Questions & Answers

sudo dmidecode where is the file located ?

Been through all my /sys /sbin /bin directories and can't seem to find it. (2 Replies)
Discussion started by: jcnewton13
2 Replies
UPSRW(8)                                                            NUT Manual                                                            UPSRW(8)

NAME
upsrw - UPS variable administration tool SYNOPSIS
upsrw ups upsrw -h upsrw -s variable [-u username] [-p password] ups DESCRIPTION
upsrw allows you to view and change the read/write variables inside your UPS. It sends commands via the server upsd(8) to your driver, which configures the hardware for you. The list of variables that allow you to change their values is based on the capabilities of your UPS equipment. Not all models support this feature. Typically, cheaper hardware does not support any of them. Run upsrw with a UPS identifier to see what will work for you. OPTIONS
-h Display the help message. -s variable Specify the variable to be changed inside the UPS. For unattended mode such as in shell scripts, use the format VAR=VALUE to specify both the variable and the value, for example: -s input.transfer.high=129 Without this argument, upsrw will just display the list of the variables and their possible values. Some variables are strings, and can be set to any value within the length limit. Others are enumerated types and can only be set to one of those values. Others may be within an allowed range of values. Refer to the list to know what's available in your hardware. -u username Set the NUT username for the connection to the server. This is optional, and you will be prompted for this when using the -s option if you don't specify -u on the command line. NUT usernames are defined in upsd.users(5), and are not linked to system usernames. -p password Set the password to authenticate to the server. This is also optional like -u, and you will be prompted for it if necessary. ups View or change the settings on this UPS. The format for this option is upsname[@hostname[:port]]. The default hostname is "localhost". UNATTENDED MODE
If you run this program inside a shell script or similar to set variables, you will need to specify all of the information on the command line. This means using -s VAR=VALUE, -u and -p. Otherwise it will put up a prompt and your program will hang. This is not necessary when displaying the list, as the username and password are not required for read-only mode. DIAGNOSTICS
upsrw can't set variables on your UPS unless you provide a valid username and password. If you get "access denied" errors, make sure that your upsd.users(5) has an entry for you, and that the username you are using has permissions to SET variables. HISTORY
This program used to be called upsct2, which was ambiguous and confusing. SEE ALSO
upsd(8), upscmd(8) Internet resources: The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ Network UPS Tools 05/24/2012 UPSRW(8)
All times are GMT -4. The time now is 11:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy