Sponsored Content
Top Forums Shell Programming and Scripting Searching the file of below pattern through perl script from different location Post 302731547 by anuragpgtgerman on Thursday 15th of November 2012 09:28:07 AM
Old 11-15-2012
its working now
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

searching pattern in another file and print

Suppose u have a file 12 22 73 another file L22D SSS S12J LLL H77K PPP J25O LOP I73S lOP K99O PLO so output shud like S12J LLL L22D SSS I73S lOP Thanks (2 Replies)
Discussion started by: cdfd123
2 Replies

2. Shell Programming and Scripting

Find a pattern in a file at a particular location

Hi all, I have a question on how to search for a pattern in a file and return a value if it is present at that particular location. How to read each line and each character for the pattern in the file of any format. Eg for the file format: attached the file (1 Reply)
Discussion started by: sparks
1 Replies

3. Shell Programming and Scripting

Perl help - Searching for a pattern and return the position

Hi, I need to search a file, in each line I need to check for occurance of '1' from a particular position through the next 32 bytes. If 1 is found, i need to return the position. Here is an example of the file and the output i need. Please help. I'm new to perl and unix. File: ... (1 Reply)
Discussion started by: gpaulose
1 Replies

4. Shell Programming and Scripting

Searching words in a file containing a pattern

Hi all, I would like to print words in a file seperated by whitespaces containing a specific pattern like "=" e.g. I have a file1 containing strings like %cat file1 The= some= in wish= born <eof> .I want to display only those words containing = i.e The= , some=,wish= ... (5 Replies)
Discussion started by: sree_123
5 Replies

5. Shell Programming and Scripting

Searching a pattern in file and deleting th ewhole line containing the pattern

Hi All, Please can someone assist in the script I have made that searches a pattern in a file and delete the whole line containing the pattern. #!bin/sh # The pattern that user want to add to the files echo "Enter the pattern of the redirect" read value # check if the user has... (1 Reply)
Discussion started by: Shazin
1 Replies

6. Shell Programming and Scripting

Script for searching a pattern in 5 files and deleting the patterns given

Hi All, I have written the below script that searches for the pattern in a file and delete them if present. please can some one have a look and suggest the changes in the script. #!bin/sh # The pattern that user want to add to the files echo "Enter the pattern of the redirect" read... (4 Replies)
Discussion started by: Shazin
4 Replies

7. Shell Programming and Scripting

Searching a pattern in a file.

Hi Guys, I am writing a shell script to extract only the error message from a log file. I am having difficulty in searching the highlighted text in the below code. <runtimeinfo datetime="Sun Apr 04 20:02:52 EDT 2008" docid="" source="RAWDATA" event="ERROR"... (2 Replies)
Discussion started by: prash1986
2 Replies

8. UNIX for Dummies Questions & Answers

Searching the date pattern in a file

Hi, I would like to search the pattern based on the date like "2010/08/15". I tried using / in the file giving /<<pattern>>. when i tried this it turns to /2010/+8, but not going to the pattern what ever i want. This is how the data in the file. INFO | jvm 1 | 2010/05/26 13:30:33... (5 Replies)
Discussion started by: venkatesht
5 Replies

9. Shell Programming and Scripting

Searching for a pattern in a file...

The problem is similar to my yesterday post I Would like an awk script that does the following: I have a file (f1) that contains 1 2 3 4 5and another one (f2) that contains 8|a 9|b 0|c 1|d 2|e 3|f 4|g 5|h 6|i 7|jAnd I'd like to get this: 1|d 2|e 3|f 4|g (5 Replies)
Discussion started by: tukuyomi
5 Replies

10. Shell Programming and Scripting

Searching and printing the only pattern using awk,sed or perl

Hi All, i have an output of command vmstat as below : $ vmstat System configuration: lcpu=4 mem=5376MB ent=1.00 kthr memory page faults cpu ----- ----------- ------------------------ ------------ ----------------------- r b avm fre re pi... (10 Replies)
Discussion started by: omkar.jadhav
10 Replies
whereami(8)						      System Manager's Manual						       whereami(8)

NAME
whereami -- non-interatively ascertain the location of the computer and reconfigure the system appropriately. SYNOPSIS
whereami [--debug ] [--scriptdebug ] [--syslog ] [--noactions ] [--nolocking ] [--mapping ] [--basedir directory ] [--statedir directory ] [--from location_list ] [--run_from calling_program_tag ] [location_list] DESCRIPTION
`whereami' provides a configurable and extensible framework for automatic location-detection and reconfiguration of computers, typically laptops. Detection Detection is handled through the use of various network and hardware probing tools. These tools have been wrapped in small shell scripts to interface them to whereami, but the end-user with different requirements may wish to extend these in some situations. whereami processes the file /etc/whereami/detect.conf performing the tests specified in there in order to decide which location the com- puter is currently located at. For full detail on the discovery process, you should read the detect.conf (5) manpage. Configuration Configuration is handled through standard shell scripting. A variety of small utility scripts are provided and the author is always will- ing to accept more. The file /etc/whereami/whereami.conf is parsed and a script built containing the actions specified there which are associated with the locations found during the detection phase. Actions may be configured for when leaving, remaining, or arriving at a location. Once the script has been built, it is run to effect the necessary changes to the system configuration. OPTIONS
This program follows the modern command-line syntax preceding each option with a double dash (`--'). Short form options are also avail- able, but are not documented (RTFC :-) --debug Run in debugging mode. A verbose output is provided and the resulting script is output to the screen and not executed. --scriptdebug Run in script debugging mode. Each script supplied with `whereami' will `set -o xtrace' if the environment variable `DEBUGWHERE- AMI' is set to non-blank. This parameter will set that variable. The script which is built by whereami will also respond to the environment variable. --syslog Output some logging information to syslog. The 'user' facility is used for this, and it provides an insight into which locations whereami has chosen, and why. In combination with --scriptdebug above, this can be very useful for debugging your configuration. Also note that the default installation turns this on for apm and init actions. --noactions Just do the detection and print the location name. Don't build and run the script from whereami.conf. You might do this if you wanted to use whereami's detection, but use something else for configuration. Perhaps you could achieve the same end with a very simple whereami.conf, but there should always be two ways to do anything :-). --nolocking whereami won't normally let two copies of whereami run at the same time. Use this option if you can come up with a scenario where you should allow this to happen! --mapping This will persuade whereami to do only the detection stage, and output a list of the detected locations, suitable for use as a mapping script with ifupdown. --hint locations Provides some hints to the detection process. The locations set by this parameter (a comma-delimited list) may be referenced by rules in your detect.conf. --basedir directory Specifies the base directory which will contain both the detect.conf and whereami.conf. The default is `/etc/whereami' which should be right for normal use. --statedir directory Specifies the state directory in which whereami will write files indicating the current and previous locations (iam , iwas) and the script which is run for this environment (whereiam.sh). --from location_list Overrides whereami's knowledge of where you have come from. The location_list will be a comma-separated list of the locations which you are leaving. Normally `whereami' maintains a history of locations, so that it knows where you have come from (and what might consequently have to be de-configured) as well as knowing that your location has changed. --run_from calling_program_tag This provides a mechanism for calling software, such as init scripts, pcmcia startup or apm events, to pass some of that source information to whereami, where it is promptly ignored, at present. I have a possibly misguided idea that this might be useful somehow, but I can't think of any application of it at this point! location_list Overrides whereami's testing of where you are. The location_list will be a comma-separated list of the locations which you are now at. You might use this if you wished to bypass the detection phase, using some other package to handle that. SEE ALSO
detect.conf (5), whereami.conf (5) There is some further documentation in HTML available in /usr/share/doc/whereami/manual FILES
/etc/whereami/detect.conf Defines the process of detection. /etc/whereami/whereami.conf Defines the actions performed as a result of entering, leaving, or remaining within a particular location. KNOWN BUGS
This man page only documents the current perl version of whereami. For backward compatibility with people's setups, it is possible to con- figure your system to run the older shell-script, which is currently undocumented. If you wish to switch from the shell script to the new perl program you will need to create an appropriate `detect.conf' file to define your location detection parameters. Your existing whereami.conf file should be compatible with this version. Once you have created a detect.conf file in /etc/whereami you should run `dpkg-reconfigure whereami' and respond to the questions. AUTHOR
This manual page was written by Andrew McMillan <debian@mcmillan.net.nz> for the Debian GNU/Linux system (but may be used by others). Per- mission is granted to copy, distribute and/or modify this document under the terms of the GPL version 2. whereami(8)
All times are GMT -4. The time now is 07:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy