Sponsored Content
Top Forums Shell Programming and Scripting Problem with regexp for IP-Adress Pattern Post 302198494 by desertchannel on Friday 23rd of May 2008 04:44:04 AM
Old 05-23-2008
Hi ripat,

thanks for your reply, but this is unforunately not working as you asume that the IP address is the only information in the line (^....$).

Here is my testfile:
Code:
1. Yes 123.25.67.8 first line
2. RIP1:171.27.38.166:spooler:spooler:/HERMES:bin
3. this is an IP128.26.18.7:
4. 81.1.0.0 valid
5. 123.114.45.6c valid
6. valid IP |12.50.1.0|
7. this is also not an IP4.0.1.1.C
8. v.55.25.1.7vNO IP
9. 20040908|394983|12.50.1.0.0|SZ/WIS/SEITE01||
10. 1.3.6.1.4.1.897.4.6.1   = dce

--> I expect line 1-6 to be found, but not 7-10
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

MAC-Adress

Hello I need to show my MAC-Adress on a Unix System, is there someone that know how? (2 Replies)
Discussion started by: nkochr
2 Replies

2. Solaris

IP-Adress

Hello together how can I find a ipadress from a login into remote system console? Thanks a lot Urs (1 Reply)
Discussion started by: MuellerUrs
1 Replies

3. HP-UX

Change IP Adress

I want change my IP address and hostname in my machine by use the console. Can any one tell me how can I execute that by command ? Thanks & Regards (1 Reply)
Discussion started by: magasem
1 Replies

4. Shell Programming and Scripting

Extract words before and after a pattern/regexp

Couldn't find much help on the kind of question I've here: There is this text file with text as: Line one has a bingo Line two does not have a bingo but it has a tango Bingo is on line three Line four has both tango and bingo Now I would want to search for the pattern "bingo" in this file... (3 Replies)
Discussion started by: manthasirisha
3 Replies

5. UNIX for Dummies Questions & Answers

print the line immediately after a regexp; but regexp is a sentence

Good Day, Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp. sed -n '/regexp/{n;p;}' filename What if my regexp is 3 word or a sentence. Im... (3 Replies)
Discussion started by: ownins
3 Replies

6. Shell Programming and Scripting

Regexp and sed problem

Basically it should identify what ever is in between /*< >*/ (tags) and replace dbname ending with (.) with the words in between the tags i.e. DELETE FROM /*<workDB>*/epd_test./*<multi>*//*<version>*/epd_tbl1 ALL; into DELETE FROM... (4 Replies)
Discussion started by: sol_nov
4 Replies

7. Shell Programming and Scripting

Trying to get an IP adress from a file

This is probably a real n00b question but i`m not able to figure it out. I have a folder of configuration files that contain IP-adresses. The line i`m interested in looks like this: IP_ADDRESS="123.123.123.1123" Some have muliple ip adresses, so the line will look like : ... (5 Replies)
Discussion started by: DaneV
5 Replies

8. Shell Programming and Scripting

Problem on understanding the regexp command

Hi all, I'm not clear of this regexp command: regexp {(\S+)\/+$} $String match GetString From my observation and testing, if $String is abc/def/gh $GetString will be abc/def I don't understand how the /gh in $String got eliminated. Please help. Thanks (2 Replies)
Discussion started by: mar85
2 Replies

9. Shell Programming and Scripting

awk regexp to print repetitive pattern

How to use regexp to print out repetitive pattern in awk? $ awk '{print $0, "-\t-\t-\t-\t-\t-\t-\t-\t-\t-\t-\t-"}' output: - - - - - - - - - - - -I tried following which does not give what I want, of course. awk '{print $0, "-\t{11}-"}' output: - ... (10 Replies)
Discussion started by: yifangt
10 Replies

10. UNIX for Beginners Questions & Answers

TCL script to delete a pattern(regexp)

Hi I am writing a TCL script to delete a certain in a file My Input file module bist_logic_inst(a, ab , dhd, dhdh , djdj, hdh, djjd, jdj, dhd, dhp, dk ); input a; input ab; input dhd; input djdj; input dhd; output hdh; output djjd; output jdj; output dk; (1 Reply)
Discussion started by: kshitij
1 Replies
FOOMATIC-CONFIGURE(1)					      General Commands Manual					     FOOMATIC-CONFIGURE(1)

NAME
foomatic-configure - the main configuration program of the foomatic printing system. SYNOPSIS
foomatic-configure [OPTION]... foomatic-configure -n queuename [ -N description ] [ -L location ] [ -c con- nect ] [ -d driver ] [ -p printer ] [ --ppd ppdfile ] [ -s spooler ] [ -C [ sourcespooler ] source- queue ] [ -o option1=value1 -o option2 ... ] [ -q ] foomatic-configure -D -n queuename [ -s spooler ] [ -q ] foomatic-configure -R -n queuename [ -s spooler ] [ -q ] foomatic-configure -Q [ -s spooler ] [ -n queuename ] [ -r ] foomatic-configure -P [ -s spooler ] [ -n queuename ] [ -d driver ] [ -p printer ] [ --ppd ppdfile ] [ index ] foomatic-configure -X -p printer | -d driver | -p printer -d driver foomatic-configure -O foomatic-configure -h foomatic-configure --help DESCRIPTION
foomatic-configure is a program to set up and configure print queues for every known spooler (CUPS, LPRng, LPD, GNUlpr, PPR, PDQ. CPS, no spooler) and every valid printer/driver combo in the Foomatic database or every PPD file coming with PostScript printers. As RIP filter (Raster Image Processor, translation from PostScript to the native language of the printer) always foomatic-rip(1) will be used, except for PPD files of PostScript printers under CUPS or PPR, they will be used without RIP filter. It also comprises half of a programatic API for user tools: you can learn and control everything about the static properties of print queues here. With the sister program foomatic-printjob(1), you can do everything related to the print queue's dynamic state: submit jobs, and query, cancel, reorder, and redirect them. Options -n queuename Configure this print queue -N Name/Description Use this proper human-readable name/description -L Location Short phrase describing this printer's location -c connection Printer is connected thusly (ex file:/dev/lp0) -d driver Foomatic database name for desired printer driver -p printer Foomatic id for printer --ppd ppdfile PPD file, for example the one supplied by the manufacturer of a PostScript printer -s spooler Explicit spooler type (cups, lpd, lprng, pdq, ppr, direct) -o option=value Set the default of option to value -o option Turn on option by default -D Set this queue as the default queue (just give -n queuename) -R Remove this whole queue entirely (just give -n queuename) -C [ sourcespooler ] sourcequeue Copy sourcequeue from sourcespooler (or the current one if sourcespooler is not given) into the queue given by -n queuename (of the current spooler). -Q Query existing configuration (gives XML summary) -r List also remotely defined queues (CUPS only) -P [ index ] Get Perl dump of current configuration (as a Perl array named QUEUES, the first index is index, or zero if index is not given) -O Print XML Overview of all known printer/drivers (this shows also the Foomatic IDs of the printers) -X Print XML data for -p printer and/or -d driver object -q Run quietly Commands No commands, just options SEE ALSO
foomatic-printjob(1), foomatic-rip(1) EXIT STATUS
foomatic-configure returns 0 if no errors occurred. AUTHOR
Manfred Wassmann <manolo@NCC-1701.B.Shuttle.de> for the foomatic project using comments from the source. BUGS
foomatic-configure currently cannot handle printcap files in the lprng style. As lprng can use BSD style printcaps this is not much of a problem, as long as the GUI based print manager lprngtool is not used. The difference between those formats is, that BSD style requires continuation lines in printer definitions to be ended with a colon and the newline character to be escaped with a backslash. Lprng has no such restriction. To use a printcap file generated or edited with lprngtool with foomatic-configure it is necessary to add : to the end of all but the last line of every printer definition, just as shown below: #comment # primary printer name lp #alternate names |lp2|lp3 |Example of a printer :sd=/usr/spool/LPD/lp :rw:lp=/dev/lp:mx#100 : must be converted to: #comment # primary printer name lp |lp2|lp3 |Example of a printer :sd=/usr/spool/LPD/lp: :rw:lp=/dev/lp:mx#100: This manpage may be out of date. Foomatic Project 2002-01-06 FOOMATIC-CONFIGURE(1)
All times are GMT -4. The time now is 02:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy