Sponsored Content
Top Forums Shell Programming and Scripting Help with awk regular expression for RS record separator Post 303001641 by 1Brajesh on Tuesday 8th of August 2017 11:10:37 AM
Old 08-08-2017
thanks drl I will take a look
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk and regular expression

Ive got a file with words and also numbers. Bla BLA 10 10 11 29 12 89 13 35 And i need to change "10,29,89,25" and also remove anything that contains actually words... (4 Replies)
Discussion started by: maskot
4 Replies

2. UNIX for Dummies Questions & Answers

regular expression and awk

I can print a line with an expression using this: awk '/regex/' I can print the line immediately before an expression using this: awk '/regex/{print x};{x=$0}' How do I print the line immediately before and then the line with the expression? (2 Replies)
Discussion started by: nickg
2 Replies

3. Shell Programming and Scripting

awk & cut record separator problem

Hi All, I've got some strange behaviour going on when trying to manipulate a file that contains spaces. My input file looks something like this: xxxxxxxxx,yyyy,sss sss sss,bbbbbbb If I use awk: When running from the command line I get: sss sss sss But when running from a... (7 Replies)
Discussion started by: pondlife
7 Replies

4. Shell Programming and Scripting

Regular expression in AWK

Hello world, I was wondering if there is a nicer way to write the following code (in AWK): awk ' FNR==NR&&$1~/^m$/{tok1=1} FNR==NR&&$1~/^m10$/{tok1=1} ' my_file In fact, it looks for m2, m4, m6, m8 and m10 and then return a positive flag. The problem is how to define 10 thanks... (3 Replies)
Discussion started by: jolecanard
3 Replies

5. Shell Programming and Scripting

awk - double quotes as record separator

How do I use double quotes as a record seperator in awk? (4 Replies)
Discussion started by: locoroco
4 Replies

6. Shell Programming and Scripting

awk, string as record separator, transposing rows into columns

I'm working on a different stage of a project that someone helped me address elsewhere in these threads. The .docs I'm cycling through look roughly like this: 1 of 26 DOCUMENTS Copyright 2010 The Age Company Limited All Rights Reserved The Age (Melbourne, Australia) November 27, 2010... (9 Replies)
Discussion started by: spindoctor
9 Replies

7. Shell Programming and Scripting

apply record separator to multiple files within a directory using awk

Hi, I have a bunch of records within a directory where each one has this form: (example file1) 1 2 50 90 80 90 43512 98 0909 79869 -9 7878 33222 8787 9090 89898 7878 8989 7878 6767 89 89 78676 9898 000 7878 5656 5454 5454 and i want for all of these files to be... (3 Replies)
Discussion started by: amarn
3 Replies

8. Shell Programming and Scripting

awk - single quotes as record separator

How do I use single quotes as record separator in awk? I just couldn't figure that out. I know how to use single quotes as field separator, and double quotes as both field and record separator ... (1 Reply)
Discussion started by: locoroco
1 Replies

9. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

10. Shell Programming and Scripting

Use string as Record separator in awk

Hello to all, Please some help on this. I have the file in format as below. How can I set the record separator as the string below in red "No. Time Source Destination Protocol Length Info" I've tried code below but it doesn't seem to... (6 Replies)
Discussion started by: cgkmal
6 Replies
BOOTPD(8)						      System Manager's Manual							 BOOTPD(8)

NAME
bootpd, bootpgw - Internet Boot Protocol server/gateway SYNOPSIS
bootpd [ -i -s -t timeout -d level -c chdir-path ] [ bootptab [ dumpfile ] ] bootpgw [ -i -s -t timeout -d level ] server DESCRIPTION
Bootpd implements an Internet Bootstrap Protocol (BOOTP) server as defined in RFC951, RFC1532, and RFC1533. Bootpgw implements a simple BOOTP gateway which can be used to forward requests and responses between clients on one subnet and a BOOTP server (i.e. bootpd) on another subnet. While either bootpd or bootpgw will forward BOOTREPLY packets, only bootpgw will forward BOOTREQUEST packets. One host on each network segment is normally configured to run either bootpd or bootpgw from inetd by including one of the following lines in the file /etc/inetd.conf: bootps dgram udp wait root /usr/sbin/bootpd bootpd bootptab bootps dgram udp wait root /usr/sbin/bootpgw bootpgw server This mode of operation is referred to as "inetd mode" and causes bootpd (or bootpgw) to be started only when a boot request arrives. If it does not receive another packet within fifteen minutes of the last one it received, it will exit to conserve system resources. The -t option controls this timeout (see OPTIONS). It is also possible to run bootpd (or bootpgw) in "standalone mode" (without inetd) by simply invoking it from a shell like any other regu- lar command. Standalone mode is particularly useful when bootpd is used with a large configuration database, where the start up delay might otherwise prevent timely response to client requests. (Automatic start up in standalone mode can be done by invoking bootpd from within /etc/rc.local, for example.) Standalone mode is less useful for bootpgw which has very little start up delay because it does not read a configuration file. Either program automatically detects whether it was invoked from inetd or from a shell and automatically selects the appropriate mode. The -s or -i option may be used to force standalone or inetd mode respectively (see OPTIONS). OPTIONS
-t timeout Specifies the timeout value (in minutes) that a bootpd or bootpgw process will wait for a BOOTP packet before exiting. If no pack- ets are received for timeout minutes, then the program will exit. A timeout value of zero means "run forever". In standalone mode, this option is forced to zero. -d debug-level Sets the debug-level variable that controls the amount of debugging messages generated. For example, -d4 or -d 4 will set the debugging level to 4. For compatibility with older versions of bootpd, omitting the numeric parameter (i.e. just -d) will simply increment the debug level by one. -c chdir-path Sets the current directory used by bootpd while checking the existence and size of client boot files. This is useful when client boot files are specified as relative pathnames, and bootpd needs to use the same current directory as the TFTP server (typically /tftpboot). This option is not recognized by bootpgw. -i Force inetd mode. This option is obsolete, but remains for compatibility with older versions of bootpd. -s Force standalone mode. This option is obsolete, but remains for compatibility with older versions of bootpd. bootptab Specifies the name of the configuration file from which bootpd loads its database of known clients and client options (bootpd only). dumpfile Specifies the name of the file that bootpd will dump its internal database into when it receives a SIGUSR1 signal (bootpd only). This option is only recognized if bootpd was compiled with the -DDEBUG flag. server Specifies the name of a BOOTP server to which bootpgw will forward all BOOTREQUEST packets it receives (bootpgw only). OPERATION
Both bootpd and bootpgw operate similarly in that both listen for any packets sent to the bootps port, and both simply forward any BOOTRE- PLY packets. They differ in their handling of BOOTREQUEST packets. When bootpgw is started, it determines the address of a BOOTP server whose name is provided as a command line parameter. When bootpgw receives a BOOTREQUEST packet, it sets the "gateway address" and "hop count" fields in the packet and forwards the packet to the BOOTP server at the address determined earlier. Requests are forwarded only if they indicate that the client has been waiting for at least three seconds. When bootpd is started it reads a configuration file, (normally /etc/bootptab) that initializes the internal database of known clients and client options. This internal database is reloaded from the configuration file when bootpd receives a hangup signal (SIGHUP) or when it discovers that the configuration file has changed. When bootpd receives a BOOTREQUEST packet, it looks for a database entry matching the client request. If the client is known, bootpd com- poses a BOOTREPLY packet using the database entry found above, and sends the reply to the client (possibly using a gateway). If the client is unknown, the request is discarded (with a notice if debug 0). If bootpd is compiled with the -DDEBUG option, receipt of a SIGUSR1 signal causes it to dump its internal database to the file /etc/bootpd.dump or the dumpfile specified as a command line parameter. During initialization, both programs determine the UDP port numbers to be used by calling getservbyname (which normally uses /etc/ser- vices). Two service names (and port numbers) are used: bootps - BOOTP Server listening port bootpc - BOOTP Client destination port If the port numbers cannot be determined using getservbyname then the values default to bootps=67 and bootpc=68. FILES
/etc/bootptab Database file read by bootpd. /etc/bootpd.dump Debugging dump file created by bootpd. /etc/services Internet service numbers. /tftpboot Current directory typically used by the TFTP server and bootpd. BUGS
Individual host entries must not exceed 1024 characters. CREDITS
This distribution is currently maintained by Walter L. Wimer walt+@cmu.edu. The original BOOTP server was created by Bill Croft at Stanford University in January 1986. The current version of bootpd is primarily the work of David Kovar, Drew D. Perkins, and Walter L. Wimer, at Carnegie Mellon University. Enhancements and bug-fixes have been contributed by: (in alphabetical order) Danny Backx db@sunbim.be John Brezak brezak@ch.hp.com Frank da Cruz fdc@cc.columbia.edu David R. Linn drl@vuse.vanderbilt.edu Jim McKim mckim@lerc.nasa.gov Gordon W. Ross gwr@mc.com Jason Zions jazz@hal.com SEE ALSO
bootptab(5), inetd(8), tftpd(8) DARPA Internet Request For Comments: RFC951 Bootstrap Protocol RFC1532 Clarifications and Extensions for the Bootstrap Protocol RFC1533 DHCP Options and BOOTP Vendor Extensions Carnegie Mellon University November 06, 1993 BOOTPD(8)
All times are GMT -4. The time now is 05:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy