Sponsored Content
Top Forums Shell Programming and Scripting replace information in a file Post 302478293 by Franklin52 on Tuesday 7th of December 2010 02:23:07 PM
Old 12-07-2010
Assuming you don't have leading or trailing spaces around the lines:
Code:
sed '/^server .*prefer$/ s/ntpserver_old/new_ntpservername/' file

Otherwise:
Code:
sed '/^[ ]*server .*prefer[ ]*$/ s/ntpserver_old/new_ntpservername/' file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File/directory information......

Basically i have done created the script below, and it functions ok, it prints the access rights the user has. But i need it to print the group permissions, and other permissions, it would also be helpful if i could print the permissions in numeric form aswell, if it is possible. I have looked in... (50 Replies)
Discussion started by: Makaveli.2003
50 Replies

2. UNIX for Dummies Questions & Answers

getting information from a file

I have a file which is of the format :- /Ixxxxxx/WORK/HANDOFF;/xxxxxx/WORK/MB_BACKUP;<servername>;<dest-servername>;\\\\CAICMESF002DATA_GRP\OPERATIONS\IBBSSPOOLS\HANDOFF\;ACHOFF*;achoff;binary;3;1;|ACHOFF.zip;0;1;0; I want to grep all capital and small OFF pattern in a format :- ... (2 Replies)
Discussion started by: kamlesh_k
2 Replies

3. Shell Programming and Scripting

Only the required tag information the XML file file

Hi i have a single line xml file having many account no tag, from which i need only the account no from the tag. any one can help on this. below is the xml file: ... (2 Replies)
Discussion started by: Saravanapk
2 Replies

4. Shell Programming and Scripting

Copying Information from One File to Another File in Shell

Hello, I'm new to scripting and I need help moving text from one file to another file. Here are examples what the files look like. File 1: Ac-223 2.10m A 1 0 0 0 Fr-219 358 9.9000E-01 0 0.0 0 0.0 0 0.0... (1 Reply)
Discussion started by: tamachan414
1 Replies

5. Shell Programming and Scripting

Create shell script to extract unique information from one file to a new file.

Hi to all, I got this content/pattern from file http.log.20110808.gz mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1 mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Discussion started by: Mr_47
16 Replies

6. Shell Programming and Scripting

reading a file extracting information writing to a file

Hi I am trying to extract information out of a file but keep getting grep cant open errors the code is below: #bash #extract orders with blank address details # # obtain the current date # set today to the current date ccyymmdd format today=`date +%c%m%d | cut -c24-31` echo... (8 Replies)
Discussion started by: Bruble
8 Replies

7. UNIX for Dummies Questions & Answers

Grep? - using a file of terms to search another file when the information is on a different line

I have a flat file that looks like this, let's call it Chromosome_9.txt: FT /Gene_Name="Guanyl-Acetylase 9" FT /Gene_Number"36952" FT /Gene_Name="Endoplasmic Luciferase" FT /Gene_Number"36953" FT ... (4 Replies)
Discussion started by: Twinklefingers
4 Replies

8. Shell Programming and Scripting

How to extract information a file according key id in another file?

hi, i have a large file containing the detailed information of a bunch of keys like this: JAT_0001 contig102_342_3_n2 contig102_342 atgcacgacta 30 50 20... (11 Replies)
Discussion started by: the_simpsons
11 Replies

9. Shell Programming and Scripting

How to create file and file content based existing information?

Hi Gurus, I am SQL developer and new unix user. I need to create some file and file content based on information in two files. I have one file contains basic information below file1 and another exception file file2. the rule is if "zone' and "cd" in file1 exists in file2, then file name is... (13 Replies)
Discussion started by: Torhong
13 Replies

10. UNIX for Beginners Questions & Answers

Search for the information at file

I'm having few question. i'm have a input file. Other information CONNECTIONS "BP-COLLECTOR" J6.4 "BP-TEST".4; +5VS C34.1 U21.1; DEV_I2C_SDA J6.6 R4.1 U18.1; DEVICES "BP-TEST" 1."BP-LED_ANODE" (8 Replies)
Discussion started by: kttan
8 Replies
globus-rls-admin(8)					      System Manager's Manual					       globus-rls-admin(8)

NAME
globus-rls-admin - Replica Location Service Administration SYNOPSIS
globus-rls-admin -A|-a|-C option value|-c option|-D|-d|-e|-p|-q|-r|-S|-s|-t timeout|-u|-v [ rli ] [ pattern ] [ server ] DESCRIPTION
The program globus-rls-admin performs administrative operations on a RLS server (see globus-rls-server(8)). OPTIONS
-A Add rli to list of RLI servers updated by an LRC server using Bloom filters. Note that partitions are not supported with Bloom fil- ters, the LRC server maintains one Bloom filter for all LFNs in its database, which is sent to all RLI servers configured to receive Bloom filter updates with this option. -a Add rli and optionally pattern to the list of RLI servers that the LRC server sends updates to (using a list of LFNs). If pattern is specified then only LFNs matching it will be sent to rli. If rli is added with no patterns, then it is sent all updates. Pat- tern matching is done using standard Unix file globbing (see fnmatch(3) or sh(1)). -C option value Set server option to value. Note this does not update the configuration file, the next time the server is restarted the configura- tion change will be lost. -c option Retrieve configuration value for specified option from server. If option is "all" then all options are retrieved. -D Remove rli and pattern from list of RLI servers that the RLI server sends updates to. If pattern is not specified then all entries for rli are removed. Note if all patterns are removed separately then rli is sent all updates. To stop any updates from being sent to rli do not specify pattern -d Remove rli and pattern from list of RLI servers that the LRC server sends updates to. If pattern is not specified then all entries for rli are removed. Note if all patterns are removed separately then rli is sent all updates. To stop any updates from being sent to rli do not specify pattern -e Clear LRC database. Removes all lfn,pfn mappings. -p Verifies that the server is responding. -q Cause RLS server to exit. -r Add rli and optionally pattern to the list of RLI servers that the RLI server sends updates to. If pattern is specified then only LFNs matching it will be sent to rli. If rli is added with no patterns, then it is sent all updates. Pattern matching is done using standard Unix file globbing (see fnmatch(3) or sh(1)). -S Show statistics and other information gathered by RLS server. Intended to be input into GRIS. -s Show list of RLI servers and patterns being sent updates by the LRC server. If rli or pattern are not specified they are considered wildcards. -t timeout Set timeout (in seconds) for RLS server requests. Default is 30 seconds. -u Cause LRC server to immediately start full softstate updates to any RLI servers previously added with the -a option. -v Show version and exit. SEE ALSO
globus-rls-server(8), globus_rls_client man pages 23 Apr 02 globus-rls-admin(8)
All times are GMT -4. The time now is 12:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy