I'm an idiot

2000-05-19 Thread Graeme Mathieson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

A number of you will have received strange messages (purporting to be Usenet
test or cancel messages) from my machine between 1700 and 1830 GMT today.
I messsed up my news server configuration which managed to spam several
people with these.

Sorry.  It wont happen again...

- -- 
Graeme.
[EMAIL PROTECTED]

Life's not fair, I reply. But the root password helps. - BOFH

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.1 (GNU/Linux)

iD8DBQE5JaFMPjGH3lNt65URAoR+AJ9pUebU1VQIkiTRTWXT1AqZPs4BZACcDhY4
mTMhVg3o8si91eKTwn52A4c=
=xXd3
-END PGP SIGNATURE-



Re: I'm an idiot

2000-05-19 Thread Ron Rademaker
Alright, the subject is right!!

Ron Rademakeker

On Fri, 19 May 2000, Graeme Mathieson wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi,
 
 A number of you will have received strange messages (purporting to be Usenet
 test or cancel messages) from my machine between 1700 and 1830 GMT today.
 I messsed up my news server configuration which managed to spam several
 people with these.
 
 Sorry.  It wont happen again...
 
 - -- 
 Graeme.
 [EMAIL PROTECTED]
 
 Life's not fair, I reply. But the root password helps. - BOFH
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.0.1 (GNU/Linux)
 
 iD8DBQE5JaFMPjGH3lNt65URAoR+AJ9pUebU1VQIkiTRTWXT1AqZPs4BZACcDhY4
 mTMhVg3o8si91eKTwn52A4c=
 =xXd3
 -END PGP SIGNATURE-
 
 
 -- 
 Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null
 



Re: I'm an idiot

2000-05-19 Thread Justin Megawarne
On Sat, May 20, 2000 at 01:31:20AM +0200, Ron Rademaker wrote:
 Alright, the subject is right!!
 
 Ron Rademakeker
 
 On Fri, 19 May 2000, Graeme Mathieson wrote:
 

Wow you sure are friendly.
-- 
__    _  __  _

Justin Megawarne [ Solitude ]   Tel: +44 (0)20 8863 0718
[EMAIL PROTECTED] Cel: +44 (0)7941 270 136

http://kholmes.dhis.net/
irc.destructor.net  irc.xchat.org - #Linux



Re: Xlib, or I'm an idiot...again

1999-08-02 Thread Jor-el
-BEGIN PGP SIGNED MESSAGE-

Dwarf,

Does your .xsession-errors file contain any information, after you
try executing these programs from the menu?

Regards,
Jor-el

Human cardiac catheterization was introduced by Werner Forssman in 1929.
Ignoring his department chief, and tying his assistant to an operating
table to prevent her interference, he placed a ureteral catheter into
a vein in his arm, advanced it to the right atrium [of his heart], and
walked upstairs to the x-ray department where he took the confirmatory
x-ray film.  In 1956, Dr. Forssman was awarded the Nobel Prize.

On Sun, 1 Aug 1999, Dale Scheetz wrote:

 On Sat, 31 Jul 1999, Jor-el wrote:
 
  -BEGIN PGP SIGNED MESSAGE-
  
  [ list changed to debian-user since this definitely belongs there ]
  
  Dale,
  
  You need to read the xauth man page.
  
  You probably tried to start the programs in question after su'ing
  to an id which was not the id used to enter your X session. Right?
 
 Right on the nose!
 
 I had su'd to root to install the new mozilla package to try it, and
 hadn't dropped back.
 
 I don't think I've had this experience before with root. What happened to
 my super user capabilities?
 
 Now the newly compiled xcircuit can be run from the prompt, and mozilla
 comes up to the splash screen before it reports a segfault ;-(
 
 Neither of the new programs will run from the menu. Is menu broken, or has
 it just changed and my package and mozilla haven't caught up?
 
 Thanks for the pointers,
 


-BEGIN PGP SIGNATURE-
Version: 2.6.3a
Charset: noconv

iQCVAwUBN6ThNPrE9j2ZpWNBAQFnYwP/UYJJFof9cg8sXoVrp2Kf+BzdU+rhBbzj
GVgUCMkJet4DPOZNiLd5ZUDICyLiTNlhDoNpZ+itnobid3eQVV7s2NvqD9/3U6fy
5EKP7oUpeeqoelfgZqAlZvs8JFGl5HO6jT+vTpaJj1T51ns5WW5fiOb9YvKBtelF
+uufFgx4W94=
=T02F
-END PGP SIGNATURE-


Re: Xlib, or I'm an idiot...again

1999-08-01 Thread Jor-el
-BEGIN PGP SIGNED MESSAGE-

[ list changed to debian-user since this definitely belongs there ]

Dale,

You need to read the xauth man page.

You probably tried to start the programs in question after su'ing
to an id which was not the id used to enter your X session. Right?

Regards,
Jorel

The Macintosh is Xerox technology at its best.

On Sat, 31 Jul 1999, Dale Scheetz wrote:

 I upgraded my system to potato a week or so ago, and since then mozilla
 will not load.
 
 I just built the newest version of xcircuit, and it refuses to load for
 the same reasons given by mozilla.
 
 Xlib: connection to :0.0 refused by server
 Xlib: Client is not authorised to connect to server
 Error: Can't open display :0.0
 
 I also can't seem to ftp into this machine any more (and I did it all the
 time before the upgrade), are all these issues related?
 
 What do I do to fix this?
 
 Waiting is,
 
 Dwarf
 --
 _-_-_-_-_-   Author of The Debian Linux User's Guide  _-_-_-_-_-_-
 
 aka   Dale Scheetz   Phone:   1 (850) 656-9769
   Flexible Software  11000 McCrackin Road
   e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308
 
 _-_-_-_-_-_- See www.linuxpress.com for more details  _-_-_-_-_-_-_-
 
 
 -- 
 To UNSUBSCRIBE, email to [EMAIL PROTECTED]
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
 
 

-BEGIN PGP SIGNATURE-
Version: 2.6.3a
Charset: noconv

iQCVAwUBN6OfhfrE9j2ZpWNBAQFphgP+KJi5KFKd/zL5Ltysb6mepCXWmRCd63v3
ZS36Wt/qwPMJLCjk8dhPXuBwal4iX1tN+ZFljU8lecruxkAcsVW9qTltFjPA9IB5
KvRPBDLWwhFeA+X/udsjehB557r/xuUbn3MMtNsSpc7XOFMzdpxYM3OVBOWwmFJm
d0AIMBfaKfo=
=O5/K
-END PGP SIGNATURE-


Re: Xlib, or I'm an idiot...again

1999-08-01 Thread Dale Scheetz
On Sat, 31 Jul 1999, Jor-el wrote:

 -BEGIN PGP SIGNED MESSAGE-
 
 [ list changed to debian-user since this definitely belongs there ]
 
 Dale,
 
   You need to read the xauth man page.
 
   You probably tried to start the programs in question after su'ing
 to an id which was not the id used to enter your X session. Right?

Right on the nose!

I had su'd to root to install the new mozilla package to try it, and
hadn't dropped back.

I don't think I've had this experience before with root. What happened to
my super user capabilities?

Now the newly compiled xcircuit can be run from the prompt, and mozilla
comes up to the splash screen before it reports a segfault ;-(

Neither of the new programs will run from the menu. Is menu broken, or has
it just changed and my package and mozilla haven't caught up?

Thanks for the pointers,

Dwarf
--
_-_-_-_-_-   Author of The Debian Linux User's Guide  _-_-_-_-_-_-

aka   Dale Scheetz   Phone:   1 (850) 656-9769
  Flexible Software  11000 McCrackin Road
  e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308

_-_-_-_-_-_- See www.linuxpress.com for more details  _-_-_-_-_-_-_-


Solved [I'm an idiot] Re: compiling mod_perl

1998-10-12 Thread Christopher Fury
DOH!  I needed to install the libgdbm-dev package.  Stupid, stupid,
stupid...
bangs head against desk

Christopher Fury wrote:
 
 I'm trying to compile mod_perl and it doesn't seem to see my gdbm
 library
 in /usr/libs:
[... blah blah ...]


-- 
Christopher Fury
Aerosoft, Inc

... a tale told by an idiot, full of sound and fury, signifying nothing.


OK, I'm an idiot.

1998-08-28 Thread Ed Slocomb
...So I did a chown lp *, but I was in /etc, not in /var/spool/lpd .  Oops.

Could some forgiving soul mail me an ls -l /etc of a 2.0 system?  I think just 
about all of those files/dirs are owned by root, but I'd like to be sure.


Resolved: I'm an idiot

1998-08-28 Thread Ed Slocomb
Ok, I think I've got it.  Looks like only smail/ and news/ are not owned by 
root in /etc .
Thanks to Brian (servis) at purdue for the quick response.

-Original Message-
From: Ed Slocomb [EMAIL PROTECTED]
To: debian-user@lists.debian.org debian-user@lists.debian.org
Date: Friday, August 28, 1998 2:21 AM
Subject: OK, I'm an idiot.


...So I did a chown lp *, but I was in /etc, not in /var/spool/lpd .  Oops.

Could some forgiving soul mail me an ls -l /etc of a 2.0 system?  I think just 
about all of those files/dirs are owned by root, but I'd like to be sure.


--  
Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED]  /dev/null




Re: I'm an idiot and sed proves it...

1997-11-30 Thread Manoj Srivastava
Hi,

Perl is your friend (tested solution).
 % perl -pli~ -e 's/\t/ /og' filename

manoj
-- 
 I have five dollars for each of you. Bernhard Goetz
Manoj Srivastava  [EMAIL PROTECTED] http://www.datasync.com/%7Esrivasta/
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-28 Thread Rick Hawkins

Dale wrote,

It seems that none of the solutions presented allowed sed to find and
replace the -newline character pair.

Now that it's phrased that way, a memory arises.

I was trying to make filters to make articles posted to a mailing list 
readable a while back (my ISN hardware  would freeze on a ^S with bit 8 high, 
which is a quote in one of the character sets).

Anyway, there were a couple of filterings that I couldn't do, as sed seemed to 
ignore certain combinations that it generated.  The solution was two filters:

cat rawfile | sed -f filter1 | sed -f filter2

which solved my problems.

rick



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-27 Thread Craig Sanders
On Wed, 26 Nov 1997, Dale Scheetz wrote:

 And this may allow me to deal with the hyphons at the end of the lines. I
 can do one pass through sed replacing new lines with \n, and then make
 another pass editing out all the '-\n'. I am still left with the problem
 of converting all the other '\n' strings back into newline characters. If
 I knew this, I could put that into the original search, so I'm left with
 trying to search for a newline.

here's a first-attempt, draft solution in perl:

#! /usr/bin/perl

$/=;  # read input in paragraphs, not lines.

while () {
s/\s+\n/\n/;# remove trailing whitespace
s/(\w+)-\n(\w+)/$1$2/g; # de-hyphenate
print
}


you'll probably need to hack it a bit to do everything you need.  enjoy.

yes, i know it's perl and not sed. i got converted some time ago :-). i
used to do this kind of stuff with sed and awk and cut and all the other
text processing tools. now i only use them for quick one-liners at the
shell prompt and use perl for scripting.  perl makes this kind of thing a
lot easier (and the extended regexps are cool too). 


craig


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-27 Thread Dale Scheetz
Well, it's time to sum up the efforts of all you good folks out there who
tried to relieve my ignorance. I want to thank you all for the information
(even Aaron was helpful) you imparted and the spirit of helpfulness for
what was clearly an off topic post.

First cntrl-v is a very nice new trick to know about, but it only worked
for the tab. Cntrl-v cntrl-j did, in fact, produce the expected line feed,
but bash then passed it as two lines and sed didn't get what it expected. 

My final solution to the -newline was to use beav to edit the file and
do a search on 2D 0A replacing it with nothing. This worked very well,
although it isn't the sed solution.

It seems that none of the solutions presented allowed sed to find and
replace the -newline character pair. From what I have read and tried
elsewhere some of the presented solutions should have worked. Reading up
on bash, I found the variable NEWLINE, but the line 'sed s/-$NEWLINE//g'
produced no better results than any of the other suggestions. I must
assume from this that sed treats the newline character as a special
character that it does not use for comparisons. While this is only
conjecture it fits what several folks said with respect to this special
character.

In any case, while it wasn't sed, I have a solution that gets me down the
road, and I enjoyed the discussion very much.

Thanks to all who helped. I will do my part to keep my comments more on
topic in the future ;-)

Luck,

Dwarf
-- 
_-_-_-_-_-_-  _-_-_-_-_-_-_-

aka   Dale Scheetz   Phone:   1 (904) 656-9769
  Flexible Software  11000 McCrackin Road
  e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308

_-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-27 Thread Craig Sanders
On Wed, 26 Nov 1997, Joost Kooij wrote:

 Before people start flooding this thread with nifty perl one-liners, I
 would really like to see how this is done with sed.

oops. too late. no script-language-religious-war intended, though. i use
perl and sed and think they're both great.

i'd also like to see how to do this in sed.

craig


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-27 Thread Eloy A. Paris
Dale Scheetz [EMAIL PROTECTED] wrote:

: You are absolutely correct, and as a developer I should probably know
: better. My only excuse is that I spend a lot of time on this list, and
: consider the folks here my friends. This leaves little time to go
: exploring other venues, and besides, I'd rather ask a favor of a friend
: than of some stranger somewhere else ;-)
:
: Personally, I find the off topic threads on this list are often very
: interesting. I almost always learn some new twist or trick that I had not
: seen before, so it is my hope that, when I have problems, the solution may
: be valuable to others as well.

I agree with you 100% Dwarf,

E.-

-- 

Eloy A. Paris
Information Technology Department
Rockwell Automation de Venezuela
Telephone: +58-2-9432311 Fax: +58-2-9431645


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


I'm an idiot and sed proves it...

1997-11-26 Thread Dale Scheetz
I've been trying to use sed to do some editing of simple characters from a
large block of ascii text. The text has tabs that I wish to replace with
spaces, and hyphonated words wrapped across linefeeds that I also wish to
remove.

For the tabs, I try the following:

sed -e 's/'\t'/ /g' infile outfile

Which very cleanly places every t in the document with a space!??

For the hyphonation I try:

sed -e 's/-'\n'//g' infile outfile

and although the file gets slightly smaller (I didn't try to find out just
what had been removed) none of the hyphonated text is corrected.

I read the man page on sed, which pointed me to the backslash special
characters, but gave no examples of their use. I have tried to figure this
out looking at other examples, but am not making any headway.

While I am positive that my problem is simple, I'm too much of an idiot to
figure it out on my own. Can someone point me in the right direction?

Thanks in advance,

Dwarf
-- 
_-_-_-_-_-_-  _-_-_-_-_-_-_-

aka   Dale Scheetz   Phone:   1 (904) 656-9769
  Flexible Software  11000 McCrackin Road
  e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308

_-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


I'm an idiot and sed proves it...

1997-11-26 Thread Aaron Denney
[EMAIL PROTECTED] wrote:
 For the tabs, I try the following:
 
   sed -e 's/'\t'/ /g' infile outfile
 
 Which very cleanly places every t in the document with a space!??
 
 For the hyphonation I try:
 
   sed -e 's/-'\n'//g' infile outfile
 
 and although the file gets slightly smaller (I didn't try to find out just
 what had been removed) none of the hyphonated text is corrected.

This isn't quite the appropriate venue for such questions, as it is
a general unix/sed question and not very specific to Debian.  In the
future try the newsgroup comp.unix.programmer or comp.unix.questions.

Your problem is that the inner quotes don't add another level quoting, but
take away another level of quoting.  To be a little clearer:

   sed -e 's/'\t'/ /g' infile outfile
^^ are the quoted parts.

The \t is not quoted, but is interpreted by your shell, which replaces the \t
with an actual t.  If you take out the inner quotes, it should work:
sed -e 's/\t/ /g' infile outfile

This will pass an actual \t to sed, which will interpret it as a tab character.

HTH.

-- 
Aaron Denney


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Dale Scheetz
On Wed, 26 Nov 1997, Aaron Denney wrote:

 [EMAIL PROTECTED] wrote:
  sed -e 's/-'\n'//g' infile outfile
  
  and although the file gets slightly smaller (I didn't try to find out just
  what had been removed) none of the hyphonated text is corrected.
 
 This isn't quite the appropriate venue for such questions, as it is
 a general unix/sed question and not very specific to Debian.  In the
 future try the newsgroup comp.unix.programmer or comp.unix.questions.

You are absolutely correct, and as a developer I should probably know
better. My only excuse is that I spend a lot of time on this list, and
consider the folks here my friends. This leaves little time to go
exploring other venues, and besides, I'd rather ask a favor of a friend
than of some stranger somewhere else ;-)

Personally, I find the off topic threads on this list are often very
interesting. I almost always learn some new twist or trick that I had not
seen before, so it is my hope that, when I have problems, the solution may
be valuable to others as well.

 
 Your problem is that the inner quotes don't add another level quoting, but
 take away another level of quoting.  To be a little clearer:
 
  sed -e 's/'\t'/ /g' infile outfile
 ^^ are the quoted parts.
 
 The \t is not quoted, but is interpreted by your shell, which replaces the \t
 with an actual t.  If you take out the inner quotes, it should work:
   sed -e 's/\t/ /g' infile outfile
 
 This will pass an actual \t to sed, which will interpret it as a tab 
 character.
 
I think that I will never understand the ins and outs of these quoting
issues. However, this doesn't provide any better fix for my problem.
Removing the inner quotes results in sed carefully replacing all t
characters by the space character, and doing nothing to the tabs. (This
was, after all, my first try, before I went looking at examples and tried
the inner quotes. Your assurances didn't make it work any better the
second or third time I tried it either.)

If all that sounds like whining and complaining, I want to make it quite
clear that I greatly appreciate the help provided.

Thanks,

Dwarf
-- 
_-_-_-_-_-_-  _-_-_-_-_-_-_-

aka   Dale Scheetz   Phone:   1 (904) 656-9769
  Flexible Software  11000 McCrackin Road
  e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308

_-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Alex Goncharov
   Resent-Cc: recipient list not shown: ;
   X-Envelope-Sender: [EMAIL PROTECTED]
   Date: Wed, 26 Nov 1997 12:02:04 -0500 (EST)
   From: Dale Scheetz [EMAIL PROTECTED]
   cc: debian-user@lists.debian.org
   Resent-From: debian-user@lists.debian.org
   X-Mailing-List: debian-user@lists.debian.org archive/latest/19637
   X-Loop: debian-user@lists.debian.org
   Precedence: list
   Resent-Sender: [EMAIL PROTECTED]
   Content-Type: TEXT/PLAIN; charset=US-ASCII
   Content-Length: 2664
   
   On Wed, 26 Nov 1997, Aaron Denney wrote:
   
[EMAIL PROTECTED] wrote:
 sed -e 's/-'\n'//g' infile outfile
 
 and although the file gets slightly smaller (I didn't try to find out 
 just
 what had been removed) none of the hyphonated text is corrected.

This isn't quite the appropriate venue for such questions, as it is
a general unix/sed question and not very specific to Debian.  In the
future try the newsgroup comp.unix.programmer or comp.unix.questions.
   
   You are absolutely correct, and as a developer I should probably know
   better. My only excuse is that I spend a lot of time on this list, and
   consider the folks here my friends. This leaves little time to go
   exploring other venues, and besides, I'd rather ask a favor of a friend
   than of some stranger somewhere else ;-)
   
   Personally, I find the off topic threads on this list are often very
   interesting. I almost always learn some new twist or trick that I had not
   seen before, so it is my hope that, when I have problems, the solution may
   be valuable to others as well.
   

Your problem is that the inner quotes don't add another level quoting, but
take away another level of quoting.  To be a little clearer:

 sed -e 's/'\t'/ /g' infile outfile
^^ are the quoted parts.

The \t is not quoted, but is interpreted by your shell, which replaces 
 the \t
with an actual t.  If you take out the inner quotes, it should work:
  sed -e 's/\t/ /g' infile outfile

This will pass an actual \t to sed, which will interpret it as a tab 
 character.

   I think that I will never understand the ins and outs of these quoting
   issues. However, this doesn't provide any better fix for my problem.
   Removing the inner quotes results in sed carefully replacing all t
   characters by the space character, and doing nothing to the tabs. (This
   was, after all, my first try, before I went looking at examples and tried
   the inner quotes. Your assurances didn't make it work any better the
   second or third time I tried it either.)
   




You should do it this way (if I understand you problem correctly):

sed -e 's/  //g' ...

^^^
This is the quoted tab -- you can enter it on bash's command line by
prefixing TAB with control-v.

Alex Goncharov

   If all that sounds like whining and complaining, I want to make it quite
   clear that I greatly appreciate the help provided.
   
   Thanks,
   
   Dwarf
   -- 
   _-_-_-_-_-_-  _-_-_-_-_-_-_-
   
   aka   Dale Scheetz   Phone:   1 (904) 656-9769
 Flexible Software  11000 McCrackin Road
 e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308
   
   _-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-
   
   
   --
   TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
   [EMAIL PROTECTED] . 
   Trouble?  e-mail to [EMAIL PROTECTED] .
   
   


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Charles Oliver

Dale Scheetz [EMAIL PROTECTED] wrote

 I've been trying to use sed to do some editing of simple characters from a
 large block of ascii text. The text has tabs that I wish to replace with
 spaces, and hyphonated words wrapped across linefeeds that I also wish to
 remove.
 
 For the tabs, I try the following:
 
   sed -e 's/'\t'/ /g' infile outfile
 
 Which very cleanly places every t in the document with a space!??
 
 For the hyphonation I try:
 
   sed -e 's/-'\n'//g' infile outfile
 
 and although the file gets slightly smaller (I didn't try to find out just
 what had been removed) none of the hyphonated text is corrected.
 
 I read the man page on sed, which pointed me to the backslash special
 characters, but gave no examples of their use. I have tried to figure this
 out looking at other examples, but am not making any headway.
 
 While I am positive that my problem is simple, I'm too much of an idiot to
 figure it out on my own. Can someone point me in the right direction?
 


In
sed -e 's/'\t'/ /g' infile outfile
try replacing the '\t' with control-V followed by a tab.

I'm not sure about how to unhyphenate words.

Charles




--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Joost Kooij
On Wed, 26 Nov 1997, Dale Scheetz wrote:

 Personally, I find the off topic threads on this list are often very
 interesting. I almost always learn some new twist or trick that I had not
 seen before, so it is my hope that, when I have problems, the solution may
 be valuable to others as well.

I agree with you here, Dale. It is very refreshing to read the occasional
thread about sed instead of the umpteenth ppp problem saga (no offense to 
people harvesting this list for answers to their ppp problems intended.)

And besides, this hasn't even turned into a sed vs. perl. vs tr vs. who
knows what obscure guineapig-tool...  yet.

  Your problem is that the inner quotes don't add another level quoting, but
  take away another level of quoting.  To be a little clearer:
  
 sed -e 's/'\t'/ /g' infile outfile
  ^^ are the quoted parts.
  
  The \t is not quoted, but is interpreted by your shell, which replaces the 
  \t
  with an actual t.  If you take out the inner quotes, it should work:
  sed -e 's/\t/ /g' infile outfile

After some messing around, I found that you actualy mustn't escape the tab
to sed, you only have to get it through bash. Just type Ctrl-V TAB and
that puts a tab character in your sed command string. Don't use ' or \
characters at all.

The other problem has me puzzled: you can easily remove the trailing -
from any line with the 's/-$//g' command, but I don't know how to get rid
of the newlines. I'm even looking in the sedawk book and I still don't
get a clue :-(

Before people start flooding this thread with nifty perl one-liners, I
would really like to see how this is done with sed.

Cheers,


Joost

PS: I think I found something that you can do with the N command. I'm not
going to try it now because it's time to go home. Maybe later unless
someone already solves it today.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Miquel van Smoorenburg
In article [EMAIL PROTECTED],
Dale Scheetz [EMAIL PROTECTED] wrote:
I've been trying to use sed to do some editing of simple characters from a
large block of ascii text. The text has tabs that I wish to replace with
spaces, and hyphonated words wrapped across linefeeds that I also wish to
remove.

For the tabs, I try the following:

   sed -e 's/'\t'/ /g' infile outfile

Which very cleanly places every t in the document with a space!??

Because of the quoting. Besides, you cannot use `\t' in a regexp. I think
that's a major oversight but, from the manpage of sed:

\c  Any backslash-escaped character c, except for `{',
   '}', `(', `)', `',  `',  `|',  and  `+'  matches
   itself.

So you can forget about \t. However you can ofcourse just enter a normal
tab with Control-V TAB. That will work though it's not obvious when you
read the code later on.

For the hyphonation I try:

   sed -e 's/-'\n'//g' infile outfile

and although the file gets slightly smaller (I didn't try to find out just
what had been removed) none of the hyphonated text is corrected.

The manpage of sed also says that each line is stripped from the newline,
put in the buffer, processed and then printed with a trailing newline.
Which means you cannot match or replace newlines. There may be a way
around it by using pattern space buffers etc but then you're talking about
programming in the sed language, something you might not want to do.


However generally you can use perl where you'd use sed, and it's more
powerful. You can do this if you like:

perl -p -e 's/-\n//' -e 's/\t/ /g' infile outfile

The '-p' is important to mimic sed's default (print) behaviour.

You might also want to look into fmt(1), which might be just what you're
looking for.

HTH

Mike.
-- 
 Miquel van Smoorenburg |  Studying to be a technomage   *
[EMAIL PROTECTED]  | May you live in interesting times


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Nathan E Norman
On Wed, 26 Nov 1997, Dale Scheetz wrote:

: On Wed, 26 Nov 1997, Aaron Denney wrote:
: 
:  [EMAIL PROTECTED] wrote:
: sed -e 's/-'\n'//g' infile outfile
:   
:   and although the file gets slightly smaller (I didn't try to find out just
:   what had been removed) none of the hyphonated text is corrected.
:  
[ snip ]
:  The \t is not quoted, but is interpreted by your shell, which replaces the 
\t
:  with an actual t.  If you take out the inner quotes, it should work:
:  sed -e 's/\t/ /g' infile outfile
:  
:  This will pass an actual \t to sed, which will interpret it as a tab 
character.
:  
: I think that I will never understand the ins and outs of these quoting
: issues. However, this doesn't provide any better fix for my problem.
: Removing the inner quotes results in sed carefully replacing all t
: characters by the space character, and doing nothing to the tabs. (This
: was, after all, my first try, before I went looking at examples and tried
: the inner quotes. Your assurances didn't make it work any better the
: second or third time I tried it either.)
: 
: If all that sounds like whining and complaining, I want to make it quite
: clear that I greatly appreciate the help provided.

I think you are having problems because bash won't let you type a tab at
the command line (I think there's a way to do it but I haven't memorised
the manpage yet).  At any rate, sed can be invoked with the -e option
and commands on the command line, yes, but it can also be invoked with
the -f option followed by a filename containing your sed command(s).

I tried your example and got the same results - it took away the 't'
character.  I then created a text file called 'sedscr' with vi.  That
file contained the following text:
s/  / /g
 ^^^ this is a tab, not a bunch of spaces

I then typed 'sed -f sedscr infileoutfile

It worked as advertised.  Hope that's what you wanted :)

ps I too thought sed interpreted a '\t' as a tab.  Apparently this is
not the case ... perl does, but sed does not.  Oh well.

: 
: Thanks,
: 
: Dwarf
: -- 
: _-_-_-_-_-_-  _-_-_-_-_-_-_-
: 
: aka   Dale Scheetz   Phone:   1 (904) 656-9769
:   Flexible Software  11000 McCrackin Road
:   e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308
: 
: _-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-
: 

--
Nathan Norman
MidcoNet - 410 South Phillips Avenue - Sioux Falls, SD  57104
Voice: (605) 334-4454 Fax: (605) 335-1173
email: [EMAIL PROTECTED] or  [EMAIL PROTECTED]
PGP Key ID: 0xA33B86E9 - Public key available at keyservers  
PGP Key fingerprint: CE03 10AF 3281 1858  9D32 C2AB 936D C472


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . Trouble? 
e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Brian K Servis
Nathan E Norman writes:

On Wed, 26 Nov 1997, Dale Scheetz wrote:

: On Wed, 26 Nov 1997, Aaron Denney wrote:
: 
:  [EMAIL PROTECTED] wrote:
:sed -e 's/-'\n'//g' infile outfile
:   
:   and although the file gets slightly smaller (I didn't try to find out 
just
:   what had been removed) none of the hyphonated text is corrected.
:  
[ snip ]
:  The \t is not quoted, but is interpreted by your shell, which replaces the 
\t
:  with an actual t.  If you take out the inner quotes, it should work:
: sed -e 's/\t/ /g' infile outfile
:  
:  This will pass an actual \t to sed, which will interpret it as a tab 
character.
:  
[snip]

ps I too thought sed interpreted a '\t' as a tab.  Apparently this is
not the case ... perl does, but sed does not.  Oh well.


According to the sed man page:

   \c  Any backslash-escaped character c, except for `{',
   '}', `(', `)', `',  `',  `|',  and  `+'  matches
   itself.

so \t = t to sed.

Brian 
-- 
Mechanical Engineering  [EMAIL PROTECTED]
Purdue University   http://www.ecn.purdue.edu/~servis


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Oliver Elphick
Dale Scheetz wrote:
  On Wed, 26 Nov 1997, Aaron Denney wrote:
   Your problem is that the inner quotes don't add another level quoting, but
   take away another level of quoting.  To be a little clearer:
   
 sed -e 's/'\t'/ /g' infile outfile
   ^^ are the quoted parts.
   
   The \t is not quoted, but is interpreted by your shell, which replaces the
   \t
   with an actual t.  If you take out the inner quotes, it should work:
  sed -e 's/\t/ /g' infile outfile
   
   This will pass an actual \t to sed, which will interpret it as a tab chara
  cter.
   
  I think that I will never understand the ins and outs of these quoting
  issues. However, this doesn't provide any better fix for my problem.
  Removing the inner quotes results in sed carefully replacing all t
  characters by the space character, and doing nothing to the tabs. (This
  was, after all, my first try, before I went looking at examples and tried
  the inner quotes. Your assurances didn't make it work any better the
  second or third time I tried it either.)
  

According to `man sed', only a few characters can be backslash-escaped,
and t is not one of them.  On the other hand it is used for _output_ by
the l command within sed.

Enclose an actual tab in the quotes; if you are typing it in and the shell 
interferes, use `ctrl-v tab'.



-- 
Oliver Elphick[EMAIL PROTECTED]
Isle of Wight  http://www.lfix.co.uk/oliver

PGP key from public servers; key ID 32B8FAA1




--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Stephen Zander
Aaron Denney wrote:
 [EMAIL PROTECTED] wrote:
  For the tabs, I try the following:
  
  sed -e 's/'\t'/ /g' infile outfile
  
  Which very cleanly places every t in the document with a space!??
  
  For the hyphonation I try:
  
  sed -e 's/-'\n'//g' infile outfile
  
  and although the file gets slightly smaller (I didn't try to find out just
  what had been removed) none of the hyphonated text is corrected.
 
 This isn't quite the appropriate venue for such questions, as it is
 a general unix/sed question and not very specific to Debian.  In the
 future try the newsgroup comp.unix.programmer or comp.unix.questions.

Lignten up :) Dale provides immense assistance to this list; he deserves
a little slack.

 Your problem is that the inner quotes don't add another level quoting, but
 take away another level of quoting.  To be a little clearer:
 
  sed -e 's/'\t'/ /g' infile outfile
 ^^ are the quoted parts.
 
 The \t is not quoted, but is interpreted by your shell, which replaces the \t
 with an actual t.  If you take out the inner quotes, it should work:
   sed -e 's/\t/ /g' infile outfile
 
 This will pass an actual \t to sed, which will interpret it as a tab characte
r.

Actually, no.  Bash requires $'\t' for the literal insertion of
an escaped character (and no, I didn't know. I looked it up :))

So your first example, Dale, becomes

sed -e s/$'\t'/' '/g  infile  outfile

and the second

sed -e s/-$'\n'//g  infile  outfile

Note the lack of surrounding quotes!


Stephen
---
Normality is a statistical illusion. -- me



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


on/off topic(was Re: I'm an idiot and sed proves it...)

1997-11-26 Thread Brian K Servis
Dale Scheetz writes:

On Wed, 26 Nov 1997, Aaron Denney wrote:

 [EMAIL PROTECTED] wrote:
 sed -e 's/-'\n'//g' infile outfile
  
  and although the file gets slightly smaller (I didn't try to find out just
  what had been removed) none of the hyphonated text is corrected.
 
 This isn't quite the appropriate venue for such questions, as it is
 a general unix/sed question and not very specific to Debian.  In the
 future try the newsgroup comp.unix.programmer or comp.unix.questions.

You are absolutely correct, and as a developer I should probably know
better. My only excuse is that I spend a lot of time on this list, and
consider the folks here my friends. This leaves little time to go
exploring other venues, and besides, I'd rather ask a favor of a friend
than of some stranger somewhere else ;-)

Personally, I find the off topic threads on this list are often very
interesting. I almost always learn some new twist or trick that I had not
seen before, so it is my hope that, when I have problems, the solution may
be valuable to others as well.


Not to start this thread again about on/off topic, splitting the
lists, etc., but if all the non-Debian specific traffic was removed
from this list there would be almost no traffic at all.  I agree with
Dale that I learn lots of great stuff by reading this list and its
non-Debian specific topics.  Really the only Debian specific traffic
is stuff relating to package management/policy, dselect/dpkg,
filesystem structure and third party .deb packages.  After you have
installed the packages it technically becomes a non-Debian specific
problem.  But who cares! As long as it can run under a Debian system I
don't mind seeing traffic about it.


My $0.02(us),
Brian 
-- 
Mechanical Engineering  [EMAIL PROTECTED]
Purdue University   http://www.ecn.purdue.edu/~servis


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Dale Scheetz
Thank you all for the many kind replies. Many of you pointed out my
mistake as did Oliver, which stems from a poor reading of the sed man
page. I blindly looked for tab and found a table of backslashed characters
and their equivalents. On second reading I discover that these are the
output characters I will see replaced for these when I use the 'l' command
with sed. This makes it quite clear why my string had the effect it did.
Dispite this, there may be some usefulness in this information, dispite my
original misunderstanding.

On Wed, 26 Nov 1997, Oliver Elphick wrote:

 According to `man sed', only a few characters can be backslash-escaped,
 and t is not one of them.  On the other hand it is used for _output_ by
 the l command within sed.
 
And this may allow me to deal with the hyphons at the end of the lines. I
can do one pass through sed replacing new lines with \n, and then make
another pass editing out all the '-\n'. I am still left with the problem
of converting all the other '\n' strings back into newline characters. If
I knew this, I could put that into the original search, so I'm left with
trying to search for a newline.

 Enclose an actual tab in the quotes; if you are typing it in and the
 shell interferes, use `ctrl-v tab'.
 
The ctrl-v works fine for a tab, but I have no newline key on my keyboard,
only an enter (which produces ^M when pressed after ctrl-v and the search
fails). Is there a way to enter a character by giving its ascii value (in
dos the alt key lets you enter the decimal value to get special
keystrokes) instead of the keypress. I guess, more important to me, will I
find the information I am looking for in the bash manpages?

Thanks again for all the help,

Dwarf
-- 
_-_-_-_-_-_-  _-_-_-_-_-_-_-

aka   Dale Scheetz   Phone:   1 (904) 656-9769
  Flexible Software  11000 McCrackin Road
  e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308

_-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Stephen Zander
Dale Scheetz wrote:
 The ctrl-v works fine for a tab, but I have no newline key on my keyboard,
 only an enter (which produces ^M when pressed after ctrl-v and the search
 fails). Is there a way to enter a character by giving its ascii value (in
 dos the alt key lets you enter the decimal value to get special
 keystrokes) instead of the keypress. I guess, more important to me, will I
 find the information I am looking for in the bash manpages?

See my last message :)

Alternately, Ctrl-V Ctrl-J will imbed a \n in your command line. Be aware,
though, that the term will act on the \n and move to the next line. It is
still there, however!


Stephen
---
Normality is a statistical illusion. -- me



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Britton

On Wed, 26 Nov 1997, Dale Scheetz wrote:

 I've been trying to use sed to do some editing of simple characters from a
 large block of ascii text. The text has tabs that I wish to replace with
 spaces, and hyphonated words wrapped across linefeeds that I also wish to
 remove.
 
 For the tabs, I try the following:
 
   sed -e 's/'\t'/ /g' infile outfile

 Which very cleanly places every t in the document with a space!??

I don't know for certain that this is the problem, but all those '
characters look very suspicious.  I think what is happening is the \t
sequence is not getting protected from the shell, which is probably going
to great pains to replace it with the literal character t, since \ (I
think) tells the shell to escape the next character.  When sed gets hold
of the string, it sees t instead of \t (which I assume means tab).  The
first thing I would try would be using \\t in place of \t, although a
cleaner solution would probably involve rearranging you ' characters
somehow. 

 For the hyphonation I try:
 
   sed -e 's/-'\n'//g' infile outfile

I'm not quite sure what is going on here.  I do know that some programs
(like grep) seem to behave strangely when you try to deal with things at
the end of lines.  By default, they want to use the end of line character
for their own insidious purposes.  I had this problem myself once trying
to fix up some Win95 m files from matlab for octave.  

 and although the file gets slightly smaller (I didn't try to find out just
 what had been removed) none of the hyphonated text is corrected.
 
 I read the man page on sed, which pointed me to the backslash special
 characters, but gave no examples of their use. I have tried to figure this
 out looking at other examples, but am not making any headway.
 
 While I am positive that my problem is simple, I'm too much of an idiot to
 figure it out on my own. Can someone point me in the right direction?
 
 Thanks in advance,
 
 Dwarf
 -- 
 _-_-_-_-_-_-  _-_-_-_-_-_-_-
 
 aka   Dale Scheetz   Phone:   1 (904) 656-9769
   Flexible Software  11000 McCrackin Road
   e-mail:  [EMAIL PROTECTED] Tallahassee, FL  32308
 
 _-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-
 
 
 --
 TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
 [EMAIL PROTECTED] . 
 Trouble?  e-mail to [EMAIL PROTECTED] .
 
 


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .


Re: I'm an idiot and sed proves it...

1997-11-26 Thread Aaron Denney
Stephen Zander wrote:
 Aaron Denney wrote:
  This isn't quite the appropriate venue for such questions, as it is
  a general unix/sed question and not very specific to Debian.  In the
  future try the newsgroup comp.unix.programmer or comp.unix.questions.
 
 Lignten up :) Dale provides immense assistance to this list; he deserves
 a little slack.

I tried not to be harsh in chewing him out...  Actually people in those
newsgroups are more likely to answer questions correctly.   This
goes for a lot of stuff on debian-user actually, even some of the more
``on-topic'' posts.  (Well not those newsgroups in particular, necessarily.)
And I did try to help, even if I wasn't much help.

  Your problem is that the inner quotes don't add another level quoting, but
  take away another level of quoting.  To be a little clearer:
  
 sed -e 's/'\t'/ /g' infile outfile
  ^^ are the quoted parts.
  
  The \t is not quoted, but is interpreted by your shell, which replaces the 
  \t
  with an actual t.  If you take out the inner quotes, it should work:
  sed -e 's/\t/ /g' infile outfile
  
  This will pass an actual \t to sed, which will interpret it as a tab 
  characte
 r.
 
 Actually, no.  Bash requires $'\t' for the literal insertion of
 an escaped character (and no, I didn't know. I looked it up :))

This is what I get for answering without actually trying something out.
:) Apologies to all, especially Dale, for the gratuitous use of
bandwidth.  The other posters seem to have helped you though.

-- 
Aaron Denney


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .