You are not gonna get much speed-up, if any at all, by using Perl.
If you could post a sample input, we might be able to help you out.
Can you post output of:
Also, you have -n switch there, so sed will not print unless explicitly instructed ('p' command). Which means output of this sed filter should be smaller than original input.
I can't post a sample because the data is sensitive.
I have yet to actually find any records that begin with .*ABCD| or end with |ABCD
The p command is in fact explicitly included because the command used is always:
sed -n -e '/^.*ABCD|/p' $fileName | sed -e 's/^.*ABCD|//' | sed -e 's/|ABCD$//' > ${fileName}.tmp
One other thing that is confusing me is that the pattern before the print matches the one after the print. The only difference seems to be that the first is being fed to print, while the second occurrence is being targeted for removal. I'm am not quite sure what the developer's intent was there.
As for sed itself, would it be safe to say that the result of this specific command would be that any entire line which either begins with any one or more characters followed by a literal ABCD and a | would be removed. And any line ending with a pipe followed by a literal ABCD and end of line would be removed?
i can only find the first occurance of a pattern how do i set it to loop untill all occurances have changed.
#! /usr/bin/perl
use POSIX;
open (DFH_FILE, "./dfh") or die "Can not read file ($!)";
foreach (<DFH_FILE>) {
if ($_ !~ /^#|^$/) {
chomp;
... (1 Reply)
Hi guys,
I have the following expression :
typeset EXBYTEC_CHK=`egrep ^"+${PNUM}" /bb/data/firmexbytes.dta`
can anybody please explain to me what
^"+${PNUM}"
stands for in egrep statement? Thanks -A (3 Replies)
Hi guys,
got a problem here with sed on the command line.
If i have a string as below:
online xx:wer:xcv: sdf:/asdf/http:https-asdfd
How can i match the pattern "http:" and replace the start of the string to the pattern with null?
I tried the following but it doesn't work:
... (3 Replies)
Hi,
I am writing a simple log parsing system and have a question on pattern matching.
It is simply grep -v -f patterns.re /var/log/all.log
Now, I have the following in my logs
Apr 16 07:33:17 ad-font-dc1 EvntSLog: AD-FONT-DC1/NTDS ISAM (700) - "NTDS (384) NTDSA: Online defragmentation... (5 Replies)
Hi guys,
I have a file in the following format:
4222 323K 323L D222
494 8134 A023 A024
49 812A 9871 9872
492 A961 A962 A963
491 0B77 0B78 0B79
495 0B7A 0B7B 0B7C
4949 WER9 444L 999O
I need to grep the line... (5 Replies)
Hi Guys,
I am trying to setup a check for the string using an "if" statement. The valid entry is only the one which contain Numbers and Capital Alpha-Numeric characters, for example: BA6F, BA6E, BB21 etc...
I am using the following "if" constract to check the input, but it fails allowing Small... (3 Replies)
Hi Guys
I am trying to check if the pattern "# sign followed by one or several tabs till the end of the line" exists in my file. I am using the following query:
$ cat myfile | nawk '{if(/^#\t*$/) print "T"}'
Unfortunately it does not return the desired output since I know for sure that the line... (4 Replies)
Hi guys
I have the following case statement in my script:
case $pn.$db in
*?.fcp?(db)) set f ${pn} cp ;;
*?.oxa?(oxa) ) set oxa $pn ;;
esac
Can somebody help me to understand how to interpret *?.fcp?(db)) or *?.oxa?(oxa) ?
I cannot figure out how in this case pattern maching... (5 Replies)
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
I need to check the condition of a variable before the script continues and it needs to match a specific pattern such as EPS-03-0 or PDF-02-1.
The first part is a 3 or 4 letter string followed by a hyphen, then a 01,02 or 03 followed by a hyphen then a 0 or a 1.
I know I could check for every... (4 Replies)
Discussion started by: stormcel
4 Replies
LEARN ABOUT REDHAT
nwbpset
NWBPSET(1) nwbpset NWBPSET(1)NAME
nwbpset - Create a bindery property or set its value
SYNOPSIS
nwbpset [ -h ] [ -S server ] [ -U user name ] [ -P password | -n ] [ -C ]
DESCRIPTION
nwbpset Reads a property specification from the standard input and creates and sets the corresponding property. The format is determined by
the output of 'nwbpvalues -c'. nwbpset will hopefully become an important part of the bindery management suite of ncpfs, together with
As another example, look at the following command line:
nwbpvalues -t 1 -o supervisor -p user_defaults -c |
sed '2s/.*/ME/'|
sed '3s/.*/LOGIN_CONTROL/'|
nwbpset
With this command, the property user_defaults of the user object 'supervisor' is copied into the property login_control of the user object
'me'.
nwbpvalues -t 1 -o me -p login_control -c |
sed '9s/.*/ff/'|
nwbpset
This command disables the user object me.
Feel free to contribute other examples!
nwbpset looks up the file $HOME/.nwclient to find a file server, a user name and possibly a password. See nwclient(5) for more information.
Please note that the access permissions of $HOME/.nwclient MUST be 600 for security reasons.
OPTIONS -h
-h is used to print out a short help text.
-S server
server is the name of the server you want to use.
-U user
user is the user name to use for login.
-P password
password is the password to use for login. If neither -n nor -P are given, and the user has no open connection to the server, nwbpset
prompts for a password.
-n
-n should be given if no password is required for the login.
-C
By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off
this conversion by -C.
AUTHORS
nwbpset was written by Volker Lendecke. See the Changes file of ncpfs for other contributors.
nwbpset 8/7/1996 NWBPSET(1)