Sponsored Content
Top Forums Shell Programming and Scripting --Parsing out strings for repeating delimiters for everyline Post 303040243 by gilgamesh on Friday 25th of October 2019 09:49:33 AM
Old 10-25-2019
So further to this discussion, would there be a way to delete one complete field ??
For example, if wanting to remove the DESCR() field.

From:
Quote:
QREMOTE(BOS.FOS.T.CDG.MEDGTOC.01) CLUSTER(CLENTT1) DEFBIND(NOTFIXED) DEFPSIST(YES) DESCR(Cargo dangerous goods queue) RQMNAME(CLCRGT1) RNAME(BOS.FOS.T.CDG.MEDGTOC.01) XMITQ( )
To:
Quote:
QREMOTE(BOS.FOS.T.CDG.MEDGTOC.01) CLUSTER(CLENTT1) DEFBIND(NOTFIXED) DEFPSIST(YES) RNAME(BOS.FOS.T.CDG.MEDGTOC.01) XMITQ( )
Tried the sed command:

Code:
sed 's/DESCR.*) R//'

But this strips the first char "R" next field, returning: NAME(BOS.FOS.T.CDG.MEDGTOC.01) XMITQ( )

Thnx again !!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

parsing with multible delimiters

I have data that looks like this aaa!bbb!ccc/ddd/eee It is not fixed format. I need to parse ddd into a var in order to decide if I want to process that row. If I do I need to put ccc and bbb into vars to process it. I need to do this during a while loop one record at a time. Any... (11 Replies)
Discussion started by: gillbates
11 Replies

2. Shell Programming and Scripting

cut columns in everyline

Is there a betterway to cut certain columns in everyline based on positions. Basically, I have a largefile and eachline is of 1000 characters and I need to cut the characters 17-30, 750-775, 776-779, 780-805 while do fptr=`cat $tempfile | head -$i | tail -1` ... (4 Replies)
Discussion started by: gunaah
4 Replies

3. Shell Programming and Scripting

Parsing file to match strings

I have a file with the following format 12g data/datasets/cct 8g data/dataset/cct 10 g data/two 5g data/something_different 10g something_different 5g data/two is there a way to loop through this... (1 Reply)
Discussion started by: yawalias
1 Replies

4. Shell Programming and Scripting

Awk new datetime everyline

Hi, I'm using awk in HP-UX machine which does not support systime(), strftime(). So to get the date time I was using : seq 1 100000 | awk ' "date +%Y%m%d%H%M%s" | getline curtime; print curtime }' However the above code gets the date only once, next time it is not updated. For... (2 Replies)
Discussion started by: Random_Net
2 Replies

5. Shell Programming and Scripting

Parsing Strings

Hello All, I am new to shell scripting and programming. I am looking for a guide on how I can parse specific information from a plain text file with thousands of lines. Specifically I need to parse an email address from each line. The line looks something like this:... (9 Replies)
Discussion started by: solvdsystems
9 Replies

6. Shell Programming and Scripting

Extract strings within XML file between different delimiters

Good afternoon! I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Discussion started by: bab@faa
3 Replies

7. UNIX for Dummies Questions & Answers

Adding variables to repeating strings

Hello, I want to add a letter to the end of a string if it repeats in a column. so if I have a file like this: DOG001 DOG0023 DOG004 DOG001 DOG0023 DOG001 the output should look like this: DOG001-a DOG0023-a DOG004 DOG001-b (15 Replies)
Discussion started by: verse123
15 Replies

8. Shell Programming and Scripting

How to append server name to everyline?

I am executing df -mP to see the disk utilization. I would like to append servername also to each and every line. df -mP | awk '{ print $1","$2","$3","$4","$5","$6 }' trying to add something like this df -mP | awk '{ print $1","$2","$3","$4","$5","$6","$hostname }' ... (1 Reply)
Discussion started by: lazydev
1 Replies

9. Shell Programming and Scripting

Script to rename the repeating strings

All, I have a sample text like below. Key (Header) Key1 ABC Key2 ABC Key3 ABC ABC Key4 ABC Key5 ABC ABC ABC Required Output Key (Header) Key1 (2 Replies)
Discussion started by: ks_reddy
2 Replies

10. Programming

Segfault When Parsing Delimiters In C

Another project, another bump in the road and another chance to learn. I've been trying to open gzipped files and parse data from them and hit a snag. I have data in gzips with a place followed by an ip or ip range sort of like this: Some place:x.x.x.x-x.x.x.x I was able to modify some code... (6 Replies)
Discussion started by: Azrael
6 Replies
BOSCONFIG(5)							AFS File Reference						      BOSCONFIG(5)

NAME
BosConfig - Defines server processes for the BOS Server to monitor DESCRIPTION
The BosConfig file lists the processes that the Basic OverSeer (BOS) Server monitors on its server machine, and thus defines which AFS server processes run on the machine. It specifies how the BOS Server reacts when a process fails, and also defines the times at which the BOS Server automatically restarts processes as part of performance maintenance. The file must reside in the /var/lib/openafs/local directory on each AFS server machine. A server process entry in the BosConfig file records the following information: o The entry type, which is one of the following: cron Designates a server process that runs periodically instead of continuously. The BOS Server starts a cron process only at specified times, not whenever it fails. All standard AFS process entries except "fs" are simple (there are no standard cron processes). fs Designates a group of interdependent server processes. If one of the processes fails, the BOS Server must coordinate its restart with the restart of the other processes in the group, possibly by stopping them first. There is only one standard entry of this type, for which the conventional name is "fs". It combines three server processes: the File Server (fileserver process), the Volume Server (volserver process), and the Salvager (salvager process). These processes all operate on the same data--the AFS data stored on an AFS server machine's /vicep partitions and mounted in the AFS filespace--but in different ways. Grouping the processes prevents them from attempting to access the same data simultaneously, which can cause corruption. During normal operation, the Salvager process is not active. If the File Server process fails, however, the BOS Server stops the Volume Server process and runs the Salvager process to correct any corruption that resulted from the failure. (The administrator can also issue the bos salvage command to invoke the Salvager process.) If the Volume Server fails, the BOS Server can restart it without stopping the File Server or running the Salvager. simple Designates a server process that runs independently of any other on the server machine. If a simple process fails, the BOS Server does not have to coordinate its restart with any other process. o The entry name. The conventional name for an entry in the BosConfig file and the associated process matches the binary filename. When issuing any bos command that takes the -instance argument, identify each process by the name used in the BosConfig file. For a list of the names, see the bos create reference page. o The process's status flag, which determines whether the BOS Server attempts to start the process in two cases: each time the BOS Server itself restarts, and when the process fails. The BosConfig file currently uses a binary notation to indicate whether the BOS Server attempts to restart the process as necessary or does not monitor it at all. For the sake of clarity, the AFS documentation refers to the flags as "Run" and "NotRun" instead. Only a system administrator, not the BOS Server, can change the flag. o One or more command parameters which the BOS Server invokes to start the process or processes associated with the entry: o A "cron" entry has two command parameters, the first the complete pathname to the program, and the second the time at which the BOS Server invokes the program. o The "fs" entry has three command parameters, each the complete pathname to the fileserver, volserver, and salvager programs, in that order. o A "simple" entry has only one command parameter, the complete pathname to the program. In addition to server process entries, the BosConfig file specifies the times at which the BOS Server performs two types of automatic process restarts: o The general restart time at which the BOS Server restarts itself and then each process for which the entry in the BosConfig file has status flag "Run". The default setting is Sunday at 4:00 a.m. o The binary restart time at which the BOS Server restarts any server process for which the time stamp on the binary file in the /usr/lib/openafs directory is later than the last restart time for the process. The default is 5:00 a.m. Although the BosConfig file is in ASCII format, it is normally best not to use a text editor to alter it. The parser is very picky, and incorrectly formatted entries can prevent server startup in ways that are difficult to diagnose. Instead, use the appropriate commands from the bos command suite: o The bos create command to create an entry in the file and start the associated process. o The bos delete command to remove an entry from the file after the bos stop command is used to stop the associated process. o The bos getrestart command to display the times at which the BOS Server performs automatic restarts. o The bos setrestart command to set the times at which the BOS Server performs automatic process restarts. o The bos start command to change an entry's status flag to "Run" and start the associated process. o The bos status command to display all processes listed in the file. o The bos stop command to change an entry's status flag to "NotRun" and stop the associated process. There are also bos commands that start and stop processes without changing entries in the BosConfig file. The BOS Server reads the BosConfig file only when it starts, transferring the information into its memory. Thus a process's status as represented in the BOS Server's memory can diverge from its status in the BosConfig file. The following commands change a process's status in the BOS Server's memory only: o The bos restart command restarts a specified set of processes, all processes, or all processes other than the BOS Server. o The bos shutdown command stops a process. o The bos startup command starts a process. When the BOS Server shuts down, it rewrites BosConfig, discarding any changes made manually to that file. To change the configuration for the next BOS Server restart, instead write a new file to BosConfig.new. If BosConfig.new exists when the BOS Server starts, it will rename that file to BosConfig before reading its configuration. SEE ALSO
bos_create(8), bos_delete(8), bos_getrestart(8), bos_restart(8), bos_setrestart(8), bos_shutdown(8), bos_start(8), bos_startup(8), bos_status(8), bos_stop(8), bos_salvage(8), fileserver(8), salvager(8), volserver(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BOSCONFIG(5)
All times are GMT -4. The time now is 03:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy