Re: Script using sed or awk

2003-09-05 Thread Bret Hughes
On Fri, 2003-09-05 at 13:12, Patrick Nelson wrote: > RH9 > > Have a php page and I want the outcome of > > du -hs /var/spool/imap/$username | awk '{print $1}' > > however, username is (say) joe.user.example.com but the directory is > joe^user^example^com >

Re: Script using sed or awk

2003-09-05 Thread Tiago Ferraz Machado - estagiario
However, if you want, here goes the "sed" solution: du -sh /var/spool/mail/`echo -e $USERNAME | sed 's/\./^/'` []`s Tiago. -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list

Re: Script using sed or awk

2003-09-05 Thread John P Verel
On 09/05/03 11:12 -0700, Patrick Nelson wrote: > RH9 > > Have a php page and I want the outcome of > > du -hs /var/spool/imap/$username | awk '{print $1}' > > however, username is (say) joe.user.example.com but the directory is > joe^user^example^com >

Re: Script using sed or awk

2003-09-05 Thread Benjamin J. Weiss
> RH9 > > Have a php page and I want the outcome of > > du -hs /var/spool/imap/$username | awk '{print $1}' > > however, username is (say) joe.user.example.com but the directory is > joe^user^example^com > > Any sed or awk experts help me do this in one lin

Script using sed or awk

2003-09-05 Thread Patrick Nelson
RH9 Have a php page and I want the outcome of du -hs /var/spool/imap/$username | awk '{print $1}' however, username is (say) joe.user.example.com but the directory is joe^user^example^com Any sed or awk experts help me do this in one line? The output is simply the amount of space u

Re: Simple AWK question

2003-06-11 Thread Vidiot
>Your syntax error is that sprintf "prints" to a string buffer, not a file. >Now, p'rhaps he wants fprintf, 'e does, Precious It is interesting how sprintf() >> "filename" has been working all the years. Probably for the wrong reason. MB -- e-mail: [EMAIL PROTECTED]

Re: Simple AWK question

2003-06-11 Thread Vidiot
>I dont have my GAWK manual handy, but I think your problem may >be that you are using SPRINTF which is a print to string function >as in str = sprintf() rather than something like fprintf() or printf() Not using gawk, using the original awk. Don't know if the original awk

Re: Simple AWK question

2003-06-11 Thread mark
> From: Vidiot <[EMAIL PROTECTED]> > Date: Wed, 11 Jun 2003 11:17:14 -0500 (CDT) > > In all my years of using awk, this is the first time I've ever had to > output a " character to a file. For example, I have the following: > > sprintf("%s,%s\n&

RE: Simple AWK question

2003-06-11 Thread Kenneth Goodwin
I dont have my GAWK manual handy, but I think your problem may be that you are using SPRINTF which is a print to string function as in str = sprintf() rather than something like fprintf() or printf() I would expect that the format overall would be INPUT_SOURCE | awk -f awk-script_file

Re: Simple AWK question5

2003-06-11 Thread Vidiot
>Try using sprintf("%c", 042 ) and whatever else you need to complete >this. Yep, that works as well as doing: SiteVal = "\"" substr(\$0,index(\$0,":")+2) "\"" and not having to do the sprintf part. Using print and just letting it string concat also works. At least I know the tric

Re: Simple AWK question

2003-06-11 Thread Anthony E. Greene
On 11-Jun-2003/11:17 -0500, Vidiot <[EMAIL PROTECTED]> wrote: >In all my years of using awk, this is the first time I've ever had to output >a " character to a file. For example, I have the following: > > sprintf("%s,%s\n", SiteVal, CustomerID) >&

Re: Simple AWK question

2003-06-11 Thread johnw02
Try using sprintf("%c", 042 ) and whatever else you need to complete this. > In all my years of using awk, this is the first time I've ever had to > output > a " character to a file. For example, I have the following: > > sprintf("%s,%s\n",

Re: Simple AWK question

2003-06-11 Thread Vidiot
>I suppose you could try > sprintf("%c%s%c,%c%s%c\n", '"', SiteVal, '"', '"', CustomerID, '"') >> >"outputfile" awk: syntax error near line 13 awk: illegal statement near line 13

RE: Simple AWK question

2003-06-11 Thread Kenneth Goodwin
> > In all my years of using awk, this is the first time I've > ever had to output > a " character to a file. For example, I have the following: > > sprintf("%s,%s\n", SiteVal, CustomerID) >> "outputfile" I suppose you cou

Re: Simple AWK question

2003-06-11 Thread Edward Croft
Have you tried using three " in a row. For example, """SiteVal""","""CustomerID""" On Wed, 2003-06-11 at 12:17, Vidiot wrote: > In all my years of using awk, this is the first time I've ever had to output > a " cha

Simple AWK question

2003-06-11 Thread Vidiot
In all my years of using awk, this is the first time I've ever had to output a " character to a file. For example, I have the following: sprintf("%s,%s\n", SiteVal, CustomerID) >> "outputfile" I need the line in the output file to look like:

report from firewall log using awk

2002-07-02 Thread Chavez Gutierrez, Freddy
Title: report from firewall log using awk I had my firewall log with lines like this:   Jun 23 04:11:42 ibop2 kernel: POSTROUTINGIN= OUT=eth1   SRC="192.168.1.10" DST=10.1.1.25 LEN=44 TOS=0x00 PREC=0x00   TTL=127 ID=34696 DF PROTO=TCP SPT=2176 DPT=80 WINDOW=8192   RES=0x00 SYN U

Re: [OT] sed/awk/bash help needed for removing lines containing a certain IP

2001-03-15 Thread Harry Putnam
[EMAIL PROTECTED] (Jonathan Wilson) writes: > Hey, > > I need to remove every single line in a bunch of log files that contain to certain >IPs, in order to find something else I'm looking for. Sounds like an awk or sed job - >anyone have an idea? > > TIA awk

Re: [OT] sed/awk/bash help needed for removing lines containing acertain IP

2001-03-15 Thread Tim Moore
egrep -v '192.168.10.100|192.168.50|10.0.0.100' /var/log/messages Jonathan Wilson wrote: > > Hey, > > I need to remove every single line in a bunch of log files that contain to certain >IPs, in order to find something else I'm looking for. Sounds like an awk or s

Re: [OT] sed/awk/bash help needed for removing lines containing a certain IP

2001-03-15 Thread Hal Burgiss
On Thu, Mar 15, 2001 at 08:45:17PM -0600, Jonathan Wilson wrote: > Hey, > > I need to remove every single line in a bunch of log files that > contain to certain IPs, in order to find something else I'm looking > for. Sounds like an awk or sed job - anyone have an idea? How

[OT] sed/awk/bash help needed for removing lines containing a certain IP

2001-03-15 Thread Jonathan Wilson
Hey, I need to remove every single line in a bunch of log files that contain to certain IPs, in order to find something else I'm looking for. Sounds like an awk or sed job - anyone have an idea? TIA Jonathan Wilson System Administ

Re: How to trim chars off words with sed, awk or something.

2001-02-15 Thread Kern, Rhonda
Title: Re: How to trim chars off words with sed, awk or something. You could use a combination of pipes to produce the list you want. ls | sed -e 's/.src.rpm//' Or, use ".i686.rpm" instead of the ".src.rpm" -- what ever you want to strip off. -Orig

Re: How to trim chars off words with sed, awk or something.

2001-02-14 Thread Harry Putnam
[EMAIL PROTECTED] (Jonathan Wilson) writes: > Hey, > > I have 2 dirs, one with all the src.rpms of the RH updates, another > with the i686 rpms. I compiled them all with a for..do loop, but some > of them didn't compile. I'd like to make a list of each dir and diff > them, but in order to so, I

Re: How to trim chars off words with sed, awk or something.

2001-02-14 Thread Matthew Melvin
lets try... find SRPMS RPMS/i386 -name *.rpm -printf '%f\n' | sed 's/\.[^\.]*\.rpm$//' | sort | uniq -c | grep ' 1' | awk '{print $2}' ... should so only things that appear just once - that is are only in SRPMS or are only in RPMS/i686 - although y

How to trim chars off words with sed, awk or something.

2001-02-14 Thread Jonathan Wilson
Hey, I have 2 dirs, one with all the src.rpms of the RH updates, another with the i686 rpms. I compiled them all with a for..do loop, but some of them didn't compile. I'd like to make a list of each dir and diff them, but in order to so, I'd have to trim .src.rpm and .i686.rpm off each filenam

Re: OT: AWK

2001-02-02 Thread Anthony Capone
Cool...thanks for the help!! Anthony Capone - Original Message - From: "Luke C Gavel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 02, 2001 12:12 PM Subject: Re: OT: AWK > On Thu, 1 Feb 2001, Anthony Capone wrote: > > > I

Re: OT: AWK

2001-02-02 Thread Luke C Gavel
On Thu, 1 Feb 2001, Anthony Capone wrote: > If I wanted awk to search through a paragraph and stop at every blank line, > display what it found, then continue to the next paragraph and do the > same...where would I start??? Perhpas something like this: awk '! /^$/ { print }

Re: OT: AWK

2001-02-01 Thread Anthony Capone
Thank you for the link!! I have downloaded the pdf and saved it! So, far it has helped me out. I just have one more question: If I wanted awk to search through a paragraph and stop at every blank line, display what it found, then continue to the next paragraph and do the same...where would I

Re: OT: AWK

2001-02-01 Thread Todd A. Jacobs
On Thu, 1 Feb 2001, Anthony Capone wrote: > I would like awk to search for the pattern: / at the beginning of the > line, followed by any number of characters, followed by : You can do this lots of ways, using perl, bash 2.x, awk, sed, or some combination of these. The trick is to unde

Re: OT: AWK

2001-02-01 Thread Luke C Gavel
On Thu, 1 Feb 2001, Anthony Capone wrote: > I am trying to get awk to display this line: > > /home/acapone: > > but I do not want it to display this: > > drwx-- 2 acapone users4096 Oct 12 08:23 temp > > I would like awk to search for the pattern: / a

Re: OT: AWK

2001-02-01 Thread Statux
> I would like awk to search for the pattern: / at the beginning of the line, > followed by any number of characters, followed by : > > I am stuck and I am not sure how to do this. Also, if anyone has some good > links on the usages of awk, I would appreciate them. I have the b

OT: AWK

2001-02-01 Thread Anthony Capone
Hi, I am sorry for this off topic, but I need help. I am trying to get awk to display this line: /home/acapone: but I do not want it to display this: drwx-- 2 acapone users4096 Oct 12 08:23 temp I would like awk to search for the pattern: / at the beginning of the line

RE: awk FS

2000-12-21 Thread Stephen_Reilly
cut -f2 -d'=' means you don't have to fire up awk to do it steve -Original Message- From: David Brett [mailto:[EMAIL PROTECTED]] Sent: 21 December 2000 16:36 To: Cameron Simpson Cc: [EMAIL PROTECTED] Subject: Re: awk FS Hi Cameron It does! I don't know how I mis

Re: awk FS

2000-12-21 Thread David Brett
to set the field separator to "=" > > Do this: > > echo this=that | awk -F= '{print$2}' > > Works just fine; prints "that" as expected. > -- > Cameron Simpson, DoD#743[EMAIL PROTECTED]http://www.zip.com.au/~cs/ >

Re: awk FS

2000-12-20 Thread Cameron Simpson
On Wed, Dec 20, 2000 at 05:26:19PM -0500, David Brett <[EMAIL PROTECTED]> wrote: | Does anybody know how to set the field separator to "=" Do this: echo this=that | awk -F= '{print$2}' Works just fine; prints "that" as expected. -- Cameron Simp

Re: awk FS

2000-12-20 Thread Vidiot
>Yes the first does not give an error but treats the line as one field >david > >On Wed, 20 Dec 2000, Vidiot wrote: > >> >Does anybody know how to set the field separator to "=" >> >david >> >> Did you try the "-F =" on the command line, or: >> >> BEGIN { >> FS = "=" >> }

Re: awk FS

2000-12-20 Thread David Brett
Yes the first does not give an error but treats the line as one field david On Wed, 20 Dec 2000, Vidiot wrote: > >Does anybody know how to set the field separator to "=" > >david > > Did you try the "-F =" on the command line, or: > > BEGIN { > FS = "=" > } > > MB

Re: awk FS

2000-12-20 Thread Vidiot
>Does anybody know how to set the field separator to "=" >david Did you try the "-F =" on the command line, or: BEGIN { FS = "=" } MB -- e-mail: [EMAIL PROTECTED] Bart: Hey, why is it destroying other toys? Lisa: They must have programmed it to elimina

awk FS

2000-12-20 Thread David Brett
Does anybody know how to set the field separator to "=" david ___ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list

awk

2000-11-21 Thread Ray Parish
I have a text file that has 4 fields. The first field is a city so it could be one word or two. So I am not able to use blank space as a fields separator. I tried awk -v FIELDWIDTHS=15 to set the field widths to 15 each. The problem I am having is I can't get the last field to prin

Re: jobs, fg, awk, oh, my

2000-11-08 Thread Cameron Simpson
On Mon, Nov 06, 2000 at 02:52:52PM -0600, Mulcahy, Chris wrote: | More than one way to do things. I was trying to do it the difficult way. | fg %xemacs works perfectly. As a learning experience for me, why would it | be doomed to failure in a script? Because jobs are a notion of the shell. The

RE: jobs, fg, awk, oh, my

2000-11-06 Thread Mulcahy, Chris
Title: RE: jobs, fg, awk, oh, my More than one way to do things.  I was trying to do it the difficult way. fg %xemacs works perfectly.  As a learning experience for me, why would it be doomed to failure in a script? Thanks Chris -Original Message- From: Mike McNally [mailto

Re: jobs, fg, awk, oh, my

2000-11-06 Thread Charles Galpin
you are missing the '%' neede before the job number. Use fg `jobs | awk '/xemacs/ {printf("%%%s\n", substr($1, 2, 1));}'` The extra '%' is to escape the oher. hth charles On Mon, 6 Nov 2000, Mulcahy, Chris wrote: > Apologies for the HTML the

jobs, fg, awk, oh, my

2000-11-06 Thread Mulcahy, Chris
Title: jobs, fg, awk, oh, my Apologies for the HTML the first time around.  It was truly a mistake. --- Greetings all! Any idea why this (line wrapping probable): ---> SNIP <--- #/bin/bash fg `jobs | awk '/xemacs/ {printf("%s\n", substr($1, 2, 1));}'` ---> S

RE: jobs, fg, awk, oh, my

2000-11-06 Thread Mike McNally
rocesses. (Because its glance inspired the distance which separates the shortest path) Mike McNally -- [EMAIL PROTECTED] -Original Message- From: Mulcahy, Chris [mailto:[EMAIL PROTECTED]] Sent: Monday, November 06, 2000 1:08 PM To: '[EMAIL PROTECTED]' Subject: jobs, fg, awk, oh,

jobs, fg, awk, oh, my

2000-11-06 Thread Mulcahy, Chris
Title: jobs, fg, awk, oh, my Greetings all! Any idea why this (line wrapping probable): ---> SNIP <--- #/bin/bash fg `jobs | awk '/xemacs/ {printf("%s\n", substr($1, 2, 1));}'` ---> SNIP <--- returns: ---> SNIP <--- fg: no job control ---> S

Re: Mass Emailing - AWK

2000-10-26 Thread Todd A. Jacobs
ions, we can simplify the flow # of the main body of the script. This makes it more readable and more # modular. ######## # 1. Export _IGNORE to the environment. Awk will only read the value if #it is an environment variable. # 2. R

Mass Emailing - AWK

2000-10-26 Thread Mark Shaw
Is there anyway I can make a Alias in my /etc/aliases file that will email everyone with a certain GID??? I just want to use awk or something that will basically grep my /etc/passwd file for everyone with the GID 500 and send them the same email message... Something like, [EMAIL PROTECTED

Re: The Awk Programing Language

2000-03-12 Thread Rick L. Mantooth
Toby, Sorry for the late reply, I found mine at Barnes and Noble for 30 something $US. I also have to recommend "Effective AWK Programming" from www.ssc.com. Tim Robbins, ISBN 1-57831-000-8 It's mostly gawk, but describes the differences. It filled in a lot of gaps the "Bib

Re: The Awk Programing Language

2000-03-04 Thread Toby A. Rider
"Steven W. Orr" wrote: > > Can I suggest instead that you look at the awk info pages. That is more > pertinent to the awk that comes on Linux and is an excellent manual in its > own right. > > To view on line, you'll find it as info pages. To print the m

Re: The Awk Programing Language

2000-03-04 Thread er-chan
www.amazon.com has Sed and Awk (nutshell handbook) $23.96 ## er-chan # at ## scn.org ### at usa.net ## On Sat, 4 Mar 2000, Steven W. Orr wrote: > Can I suggest instead that you look at the awk info pages. That is more > pertinent to the awk that comes on Linux and

Re: The Awk Programing Language

2000-03-04 Thread Steven W. Orr
Can I suggest instead that you look at the awk info pages. That is more pertinent to the awk that comes on Linux and is an excellent manual in its own right. To view on line, you'll find it as info pages. To print the manual, just run texi2dvi on the .texinfoi file. Easy peasy. -- -Time

The Awk Programing Language

2000-03-04 Thread Toby A. Rider
Sorry for this being slightly unrelated to Linux, but more of a general Unix question. Does anyone know where I can a copy of "The Awk Programming Language", ISBN 0-201-07981-X for less then $41.00 US? I love that little book and have been borrowing it from one of the other S

RE: scripts (awk or perl or what?)

2000-01-20 Thread Coote, Chris F \(Regency\)
I don't recall how to regexprepl all occurences with one pass, but using a script lang like tcl w/sed: ## Repeat using a do while to change from CSV to oeSV: set newdata [exec sed -e s/","/oe/ << $data] ## ##Then: set listdata [split $newdata oe] ## -- To unsubscribe: mail [EMAIL PROTECTED] w

Re: scripts (awk or perl or what?)

2000-01-19 Thread Paul M. Foster
On Tue, 18 Jan 2000, Gate wrote: > I need to do the following two things (separately): > > First.. I have a file with comma delineated fields. The data in each field > is enclosed in double quotes ("). However, some data fields have a quote > within the quotes, and I need to remove that. What

Re: scripts (awk or perl or what?)

2000-01-19 Thread Alan Mead
At 02:40 PM 1/18/00 -0800, Gate wrote: >I need to do the following two things (separately): > >First.. I have a file with comma delineated fields. The data in each field >is enclosed in double quotes ("). However, some data fields have a quote >within the quotes, and I need to remove that. What is

Re: scripts (awk or perl or what?)

2000-01-19 Thread Rick L. Mantooth
e all fields are enclosed in '"' chars. => Anyway, if the fieled is enclosed in '"' chars, you have to escape any '"' => characters in the data with another '"' like this '""'. => => So, I think better test data

Re: scripts (awk or perl or what?)

2000-01-19 Thread Charles Galpin
unk_1","Junk_2","Junk"_3","Junk_4" "Junk""_5","""Junk_6""",",Junk_7,","Ju,""nk_8" Which this script does not handle properly. I honestly don't know awk well enough to fix i

Re: scripts (awk or perl or what?)

2000-01-19 Thread Charles Galpin
> First.. I have a file with comma delineated fields. The data in each field > is enclosed in double quotes ("). However, some data fields have a quote > within the quotes, and I need to remove that. What is my best choice for > this? As Alan said, this is CSV. If you can tell me how many fields

scripts (awk or perl or what?)

2000-01-19 Thread Gate
I need to do the following two things (separately): First.. I have a file with comma delineated fields. The data in each field is enclosed in double quotes ("). However, some data fields have a quote within the quotes, and I need to remove that. What is my best choice for this? Second.. A text f

Re: scripts (awk or perl or what?)

2000-01-19 Thread Rick L. Mantooth
Bryan, Don't listen to those perl guys... ;-) See below On Tue, 18 Jan 2000, Gate wrote: => I need to do the following two things (separately): => => First.. I have a file with comma delineated fields. The data in each field => is enclosed in double quotes ("). However, some data fields have a