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
>
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
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
>
> 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
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
>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]
>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
> 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&
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
>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
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) >&
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",
>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
>
> 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
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
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:
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
[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
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
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
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
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
[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
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
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
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
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 }
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
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
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
> 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
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
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
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/
>
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
>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 = "="
>> }
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
>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
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
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
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
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
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
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
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,
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
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
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
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
"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
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
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
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
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
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
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
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
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
> 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
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
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
61 matches
Mail list logo