[opensuse] OT: bash F1
Hi Listmates, Current code: CURNUM=`ls /etc/apache2/sites-enabled|cut -d- -f1|tail -1` NEWNUM=`expr $CURNUM + 1` NUMLEN=`expr length $NEWNUM` if [ -z $CURNUM ] then FID="001" elif [ $NUMLEN -eq "1" ] then FID="00$NEWNUM" elif [ $NUMLEN -eq "2" ] then FID="0$NEWNUM" elif [ $NUMLEN -eq "3" ] then FID=$NEWNUM Fi Basically searches /etc/apache2/sites-enabled for filenames that are like: 001-site1 002-site2 And finds last value and then adds +1 to it. Let or expr doesn't want to work with numbers starting with 0, makes sense, but I haven't found a way to force it either, so I'm wondering if there is a clever solution to this, bash-wise, or this should do it ? (taking there won't be 4 digits of sites; more likely it will not hit 2 digits, but better be safe than sorry!) Thanks. -- Best regards, Nick Zeljkovic -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 17 August 2008 14:36, Nick Zeljkovic wrote:
Hi Listmates,
Current code: CURNUM=`ls /etc/apache2/sites-enabled|cut -d- -f1|tail -1` NEWNUM=`expr $CURNUM + 1` NUMLEN=`expr length $NEWNUM`
if [ -z $CURNUM ] then FID="001" elif [ $NUMLEN -eq "1" ] then FID="00$NEWNUM" elif [ $NUMLEN -eq "2" ] then FID="0$NEWNUM" elif [ $NUMLEN -eq "3" ] then FID=$NEWNUM Fi
Basically searches /etc/apache2/sites-enabled for filenames that are like: 001-site1 002-site2
And finds last value and then adds +1 to it. Let or expr doesn't want to work with numbers starting with 0,
Expr does not treat leading zeroes as special. But beware that BASH's "let" built-in, which is vaguely similar to "expr," will treat such numbers as octal. % expr 20 + 1 21 % expr 020 + 20 40 % expr 0020 + 020 + 20 60
makes sense, but I haven't found a way to force it either, so I'm wondering if there is a clever solution to this, bash-wise, or this should do it ? (taking there won't be 4 digits of sites; more likely it will not hit 2 digits, but better be safe than sorry!)
I would check what's coming out of your "cut" command. It may not be what you think.
Thanks.
-- Best regards, Nick Zeljkovic
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Randall R Schulz"
On Sunday 17 August 2008 14:36, Nick Zeljkovic wrote:
Hi Listmates,
Current code: CURNUM=`ls /etc/apache2/sites-enabled|cut -d- -f1|tail -1` NEWNUM=`expr $CURNUM + 1` NUMLEN=`expr length $NEWNUM`
if [ -z $CURNUM ] then FID="001" elif [ $NUMLEN -eq "1" ] then FID="00$NEWNUM" elif [ $NUMLEN -eq "2" ] then FID="0$NEWNUM" elif [ $NUMLEN -eq "3" ] then FID=$NEWNUM Fi
Basically searches /etc/apache2/sites-enabled for filenames that are like: 001-site1 002-site2
And finds last value and then adds +1 to it. Let or expr doesn't want to work with numbers starting with 0,
Your cut command looks like it's going to give you "/etc/apache2/sites" every time. You should sort your result because ls garantees no particular order unless using ie -lt which is time anyways not numerical. You don't need expr as long as you are using bash or ksh or zsh or almost anything but stock sh on sco unix or solaris. #!/bin/bash unalias ls ## grr F*&^* distros... A=`cd /etc/apache2/sites-enabled ;ls |cut -d- -f1 |sort -n |tail -1` A=`printf "%03i\n" $((++A))` In ksh you don't need to spawn a sub shell just to use printf just to get it back to right-justifid, zero-padded, 3 digits. Nor do you need the subshell nor any of the processes in the backticks with ls either as long as we're making any assumptions about the filenames anyways. There is a quirk that you must start with 001 though. You can have a file 000-site0, and other files of other forms, just this script will never see those. #!/bin/ksh typeset -Z3 A=001 cd /etc/apache2/sites-enabled while [ -e ${A}-* ] ;do ((++A)) ;done In both cases $A holds the new/next value at the end echo Next site is $A -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 17 August 2008 17:18, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
... Your cut command ...
You replied to my post but addressed only content from the post to which mine was a reply.
-- Brian K. White
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Randall R Schulz"
On Sunday 17 August 2008 17:18, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
... Your cut command ...
You replied to my post but addressed only content from the post to which mine was a reply.
I replied to the thread. -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 17 August 2008 18:06, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
To: Sent: Sunday, August 17, 2008 9:03 PM Subject: Re: [opensuse] OT: bash F1 On Sunday 17 August 2008 17:18, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
... Your cut command ...
You replied to my post but addressed only content from the post to which mine was a reply.
I replied to the thread.
There is no such thing as replying to a thread. You reply to a particular post which is part of a thread. You should choose the post to which you reply based on the content you wish to address in that reply. Otherwise phrases like "Your cut command" seem to refer to my (Randall R. Schulz's) "cut command" when in fact I neither suggested nor stated any such command.
-- Brian K. White
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Randall R Schulz"
On Sunday 17 August 2008 18:06, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
To: Sent: Sunday, August 17, 2008 9:03 PM Subject: Re: [opensuse] OT: bash F1 On Sunday 17 August 2008 17:18, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
... Your cut command ...
You replied to my post but addressed only content from the post to which mine was a reply.
I replied to the thread.
There is no such thing as replying to a thread. You reply to a
1) Of course there is.
particular post which is part of a thread. You should choose the post to which you reply based on the content you wish to address in that reply.
Otherwise phrases like "Your cut command" seem to refer to my (Randall R. Schulz's) "cut command" when in fact I neither suggested nor stated any such command.
2) I had already deleted the original post. Ergo: see 1). This argument is admittedly technically valid, and as such I am sorry I forgot to go up and clean off your attribution from the quoting, but then again, I didn't remove the OP's either or change the nuber of layers, so the argument is a bit weak. Perhaps the only answer I should have offered to the charge was a simple "Yes, I did." with a "so what?" left unspoken but implied. -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 17 August 2008 20:03, Brian K. White wrote:
...
I replied to the thread.
There is no such thing as replying to a thread. You reply to a particular post which is part of a thread. ...
1) Of course there is.
No, there is not. Each reply includes a header that specifies the specific message to which it is a reply.
...
This argument is admittedly technically valid, ...
Thank you. Now please don't reply to my posts unless you're addressing something _I_ wrote.
...
-- Brian K. White
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Randall R Schulz"
On Sunday 17 August 2008 20:03, Brian K. White wrote:
I replied to the thread.
There is no such thing as replying to a thread. You reply to a particular post which is part of a thread. ...
1) Of course there is.
No, there is not.
Of course there is.
Each reply includes a header that specifies the specific message to which it is a reply.
So?
This argument is admittedly technically valid, ...
Thank you. Now please don't reply to my posts unless you're addressing something _I_ wrote.
You get to make such a request, but you shouldn't expect it to have any meaning. -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 18 Aug 2008 03:12:39 -0400, Brian K. White wrote:
No, there is not.
Of course there is.
Each reply includes a header that specifies the specific message to which it is a reply.
So?
So you reply to a message within a thread, not a thread itself. Therefore you should always reply to the right message otherwise you won't get a correct threading. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 8/18/08, Philipp Thomas
On Mon, 18 Aug 2008 03:12:39 -0400, Brian K. White wrote:
No, there is not.
Of course there is.
Each reply includes a header that specifies the specific message to which it is a reply.
So?
So you reply to a message within a thread, not a thread itself. Therefore you should always reply to the right message otherwise you won't get a correct threading.
Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I think the main difference is that some mail clients support threading while others don't. To reply properly you should know about both. A user who uses a threading client does not need a lot of quotes, therefore it can seem useless to a "threading" user to post a long quote. A reply to a wrong message can mess up the threading, because some of the threading clients can see what message is used to replie to (google doesn't). A user who uses a non-threading client needs these qoutes but doesn't care wether the reply is posted to the correct message. The quotes should provide him with enough information to understand the problem. Usually this is no problem, because the need to qoute is quite clearly stated and the easiest message to quote from is the message you should reply to anyway. just my €0.02. Neil btw: if my recapping of problems is undesired please tell me. -- There are two kinds of people: 1. People who start their arrays with 1. 1. People who start their arrays with 0. ----------------------------------------------------------------------- ** Hi! I'm a signature virus! Copy me into your signature, please! ** ----------------------------------------------------------------------- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 18 August 2008 01:53, Neil wrote:
...
I think the main difference is that some mail clients support threading while others don't. To reply properly you should know about both.
Yeah, and Mr. White uses Outlook, the worst abomination ever perpertrated by that company in Redmond. Outlook should be banned from this list. In fact, it should be banned from the Internet.
...
Neil
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, August 18, 2008 15:42, Randall R Schulz wrote:
On Monday 18 August 2008 01:53, Neil wrote:
...
I think the main difference is that some mail clients support threading while others don't. To reply properly you should know about both.
Yeah, and Mr. White uses Outlook, the worst abomination ever perpertrated by that company in Redmond.
Outlook should be banned from this list. In fact, it should be banned from the Internet.
You are confusing Outlook and Outlook Express. In the headers I saw the following: Mailer: Microsoft Outlook Express 6.00.2900.5512 Outlook Express is installed with Windows and has the same version as Internet Explorer. From version 7 onward, I think it is called MS Live Mail. I agree that OE is complete and utter male cow excrement. It is a highway to hell and an open door for viruses, worms and other nasty stuff. There is only one email client that I hate more, and that is Incredimail. Outlook otoh, is part of the MS Office suite (so it costs money), and is the preferred mail client for MS Exchange servers. It doesn't just do mail, but also calendar, tasks, notes, contacts,... MS Office Outlook has a Linux counterpart: Ximian Evolution. MS Office Outlook can be forced, but with a lot of blood sweat and tears, to behave a bit polite, not like OE who shits in all corners. But please: this list is about OpenSuse, not about anti-M$-rants. -- Amedee -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 18 Aug 2008 16:37:52 +0200 (CEST), Amedee Van Gasse wrote:
Outlook otoh, is part of the MS Office suite (so it costs money), and is the preferred mail client for MS Exchange servers.
AFAIK, Outlook still won't generate correct In-Reply-To header entries so it's still useless for email. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Randall R Schulz"
On Monday 18 August 2008 01:53, Neil wrote:
...
I think the main difference is that some mail clients support threading while others don't. To reply properly you should know about both.
Yeah, and Mr. White uses Outlook, the worst abomination ever perpertrated by that company in Redmond.
No I don't. I can't stand Outlook. As long as we're being oversensative about points of attribution that have no impact on anyones lives other than to cause dumb arguments on mail lists. I use something even worse, because as a die hard old school unix guy I'm too practical and clueful to waste time downloading thunderbird everywhere, or worse, installing linux desktops, or goofy crap like rebooting every machine I sit in front of to a knoppix thumb drive... But, what's it to you? I configure it to send only in plain text. Any other problems it has are purely my problem. I would have posted that stupid reply that has your pants in a bunch exactly the same way in any interface. And my failure to feel chastised over it, which I'm sure is the real problem, would likewise not have been any different had I been using some holier email client. Whether I am using mutt or pine or one of my own self-witten mua's, or outlook express, or pan or swiftdove or *gag* gmail, at no time am I either confused or constipated by which exact message any particular post in a conversation happens to be technically a reply to, as defined by the message-id's in the header. A conversation is a conversation. It's a human abstract construct. The email systems message tagging system is a somewhat handy tool, but it does not dictate what humans say to each other or when or how or why. At least not me. There is such a thing is nettiquette that helps keep things sane for all concerned, but good grief get over it. It wasn't even a mis-attribution! Your name merely appeared in the post that you had in fact been a part of. -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 18 August 2008 07:56, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
To: Sent: Monday, August 18, 2008 9:42 AM Subject: Re: [opensuse] Replying to threads (was: Re: OT: bash F1) ...
Yeah, and Mr. White uses Outlook, the worst abomination ever perpertrated by that company in Redmond.
No I don't.
The headers in your posts say otherwise: X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
...
But, what's it to you?
Outlook and Outlook Express don't conform to the standards and this failure, among many problems, leads people to believe that there is no difference between replying to a thread and replying to a specific post.
.... And my failure to feel chastised over it, which I'm sure is the real problem, ...
Part of ordinary social grace is to admit when you've done something wrong rather than defend your mistake as something that's perfectly OK.
...
-- Brian K. White
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Randall R Schulz"
On Monday 18 August 2008 07:56, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
To: Sent: Monday, August 18, 2008 9:42 AM Subject: Re: [opensuse] Replying to threads (was: Re: OT: bash F1) ...
Yeah, and Mr. White uses Outlook, the worst abomination ever perpertrated by that company in Redmond.
No I don't.
The headers in your posts say otherwise:
No they don't. How many times & ways must you prove yourself dense?
X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
This is amazing. You collected the info, copied & pasted it, And still don't know what it says? Outlook != Outlook Express. One is not a subset or superset of the other except by definitions so loose as to be meaningless. If you didn't know this, then you don't know enough about the programs to have any foundation for commenting on their quality or lack of same. That means you're just another mouth repeating what you hear the smart-sounding people say.
...
But, what's it to you?
Outlook and Outlook Express don't conform to the standards and this failure, among many problems, leads people to believe that there is no difference between replying to a thread and replying to a specific post.
Who's confused? I'm not the one who can't read. I was not the slightest bit confused about what I was douing when I posted. Forgetting to clean up the attributions _perfectly_ was not confusion but simple sloppiness. Well you got me there! ooooh! And it still had nothing to do with the silly mail client being used at the time. Besides I thought there was no such thing as replying to a thread? Make up your mind. Also-also, what are these standards you speak of? It adheres perfectly with the "standards". (by which I at least mean smtp). Perhaps you confuse obligation with convention? Holy cow you sure packed a lot of gibberish into that one little sentence.
.... And my failure to feel chastised over it, which I'm sure is the real problem, ...
Part of ordinary social grace is to admit when you've done something wrong rather than defend your mistake as something that's perfectly OK.
I didn't defend the mistake. There was a teeny actual mistake in there and it got the teeny apology it deserved. (twice, now.) You want more, that's you're problem. And _that's_ all this thread is about any more. You want more apology than you have any right to and you're not going to get it, and apparently haven't come to grips with this fact of life. I am not going to help with this problem you are having in the way that you want. Go join a Martha Stewart list if you value social grace more than the work at hand here. The way I read the charter, this place is here for receiving and dispensing help, and otherwise discussing various aspects of, linux in general and opensuse in particular. Well that's what that post was doing. It was reasonable to bring the slip to my attention. It was not reasonable to actually care about it much even initially. To still care about it by now borders on the obsurd or the pathetic. If it was an actual breach of standards or expressed policy or convention that'd be one thing. Like, say top-posting, posting in html, not quoting enough or at all, quoting too much, etc.. All things I'll perfectly freely admit to having done on occasion btw. But, when you get right down to it, that post actually did none of those things. And that's why this thread is probably going to continue untill you get tired of it. I'm not really stressed or upset or even especially annoyed by your attempts to somehow make some sort of case. So I'm fine with pointing out the flaws in your arguments as long as you want to keep trying to come up with them. And who knows you may make a valid point after all and then I'll have expanded my horizons a little by having something pointed out to me that I hadn't thought of before. I'll then thank you for helping me grow as a person. It could happen. I'm merely firm in my sense of reason, not prejudiced. Do you _really_ suppose there is any _slight_ gain to be had by continuing this thread? How's this for social grace: Let's just say I am actually in the wrong, but I'm such a jerk I'll never admit it. Is there any slight doubt in your mind by now what my stance is on this topic? What does the socially graceful person do when confronted with such a situation? bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 18 August 2008 11:03, Brian K. White wrote:
...
Do you _really_ suppose there is any _slight_ gain to be had by continuing this thread? ...
Evidently you do. You've written dozens of words for each one I have.
bkw
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Randall R Schulz"
On Monday 18 August 2008 11:03, Brian K. White wrote:
...
Do you _really_ suppose there is any _slight_ gain to be had by continuing this thread? ...
Evidently you do. You've written dozens of words for each one I have.
So what? I'm not in it for gain. I notice a conspicuous lack of address to any substantive point or counterpoint. bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 18 August 2008 19:21:01 Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
To: Sent: Monday, August 18, 2008 2:10 PM Subject: Re: [opensuse] Replying to threads (was: Re: OT: bash F1) On Monday 18 August 2008 11:03, Brian K. White wrote:
...
Do you _really_ suppose there is any _slight_ gain to be had by continuing this thread? ...
Evidently you do. You've written dozens of words for each one I have.
So what? I'm not in it for gain. I notice a conspicuous lack of address to any substantive point or counterpoint.
bkw I think I can speak for the rest of the list when I say SO CAN WE!!!! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Philip Burness
I think I can speak for the rest of the list when I say SO CAN WE!!!!
Please do not presume upon the *rest* of us and don't shout. If the topic was so unworthy of defense, the voluminous outpouring was certainly unwarranted as was the mere fact of continuation. -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 8/18/08, Patrick Shanahan
* Philip Burness
[08-18-08 14:28]: I think I can speak for the rest of the list when I say SO CAN WE!!!!
Please do not presume upon the *rest* of us and don't shout.
If the topic was so unworthy of defense, the voluminous outpouring was certainly unwarranted as was the mere fact of continuation.
Well, I do believe he was referring to On Monday 18 August 2008 19:21:01 Brian K. White wrote:
So what? I'm not in it for gain
While that isn't entirely true (a lot of users do want their problem solved, wich could be considered "gain") it is close enough to the thruth to presume upon the rest of us. (I could get very filosofical on this and prove that everyone does everything for gain, but that's beside the point.) Neil -- There are two kinds of people: 1. People who start their arrays with 1. 1. People who start their arrays with 0. ----------------------------------------------------------------------- ** Hi! I'm a signature virus! Copy me into your signature, please! ** ----------------------------------------------------------------------- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 8/18/08, Patrick Shanahan
* Philip Burness
[08-18-08 14:28]: I think I can speak for the rest of the list when I say SO CAN WE!!!!
Please do not presume upon the *rest* of us and don't shout.
If the topic was so unworthy of defense, the voluminous outpouring was certainly unwarranted as was the mere fact of continuation.
-- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I thought there was another mailing list for these discussions: The Opensuse Offtopic list: To unsubscribe, e-mail: opensuse-offtopic+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-offtopic+help@opensuse.org Neil -- There are two kinds of people: 1. People who start their arrays with 1. 1. People who start their arrays with 0. ----------------------------------------------------------------------- ** Hi! I'm a signature virus! Copy me into your signature, please! ** ----------------------------------------------------------------------- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Monday 18 August 2008 11:21, Brian K. White wrote:
...
So what? I'm not in it for gain.
What, then? You seem to want to rant, when all that was ever called for was a simple one-sentence acknowledgment that you made a mistake. Or silent consent.
I notice a conspicuous lack of address to any substantive point or counterpoint.
You may claim to have nothing to gain, but I simply don't care one way or another about all your bombast.
bkw
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
*snip* rant between Mr. White & Mr. Schulz *snip* How long are you guys going to continue this? The lack of social grace is detrimental to the work at hand on this list. The time spent on writing rants could be better spent. At first it was a bit funny to read, but now I am seriously considering to move the opensuse list below the spambayes lines in my procmail and moving mail from certain senders to my .ztrain.confirmed-spam folder. It's a shame that a newcomer as myself has to be confronted with such things... -- Amedee -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, Aug 18, 2008 at 7:56 AM, Brian K. White
But, what's it to you? I configure it to send only in plain text. Any other problems it has are purely my problem.
Without intending to jump into the Flame fest.... Brian, the above is not true, it (OE) causes lots of problems for EVERYBODY on the mailing list because it breaks threading for EVERYONE, not _just_ you. That's why everyone goes off the deep end about OE so much, not because its broken for you, (which is your business) but, rather, that it breaks threads for everyone else by failure to include the entire thread reference in the headers. It totally messes up a mailing list by fracturing threads of messages into individual posts that appear totally unrelated except by title. No one can tell you what to use, but if you just want to avoid installing thunderbird, why not get read the list with something that requires NO installation ANYWHERE? Like Gmail? -- ----------JSA--------- Someone stole my tag line, so now I have this rental. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "John Andersen"
On Mon, Aug 18, 2008 at 7:56 AM, Brian K. White
wrote: But, what's it to you? I configure it to send only in plain text. Any other problems it has are purely my problem.
Without intending to jump into the Flame fest....
Brian, the above is not true, it (OE) causes lots of problems for EVERYBODY on the mailing list because it breaks threading for EVERYONE, not _just_ you.
That's why everyone goes off the deep end about OE so much, not because its broken for you, (which is your business) but, rather, that it breaks threads for everyone else by failure to include the entire thread reference in the headers. It totally messes up a mailing list by fracturing threads of messages into individual posts that appear totally unrelated except by title.
No one can tell you what to use, but if you just want to avoid installing thunderbird, why not get read the list with something that requires NO installation ANYWHERE? Like Gmail?
Hm. In that case you've told me something I didn't know. I happened to stop preferring thread view years ago and prefer to just read new posts in chronological order and "thread" them mentally. That's why I was mystified by the much smaller confusion a while back over another odd post where I needed to add a comment to a thread from a client that had no prior posts locally in the client at all since it was knoppix or maybe a transient install. So I posted with an obviously (to me) similar and related subject but freehand not an exact copy byte for byte, and lacking an actual post to quote I referred to it freehand, paraphrased as it were, and added the new info. I can't understand why that confused anyone. There was no fight or anything that time, it was just a little "twilight zone". Are we that helpless? Sadly I do need to use OE at least sometimes, both for testing so that my software stays perfectly compatible with most of my users mail clients and, In order to support the customers to the standard I wish, I pretty much have to actually use the same things they use. Not all the time for everything, but regularly enough so that I stay fully conversant with it down to the small day to day details. I don't want to tell them things like "configure you email client to use smtp on port 3525", I need to be able to be sitting in a cafe and walk them through each dialog exactly with no pc in front of me at least for the common things. But I don't need to use OE 100% of the time for that I guess. gmail? you like gmail? ('course, it's not like I actually "like" oe either. it just is. So I can't exactly call gmail worse.) -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, Aug 18, 2008 at 1:04 PM, Brian K. White
gmail? you like gmail? ('course, it's not like I actually "like" oe either. it just is. So I can't exactly call gmail worse.)
Well it has some draw backs and limitations, as does everything else. When replying to this list, I have to Reply to All, and then clear the TO field leaving the CC field pointing to the list. I've gotten used to it. It wants to top post by default, (grrrrr) but that just gives me an opportunity to trim my posts as I move down to bottom post. Every three months I nag gmail tech support about adding a bottom-post preference. But, yeah, by and large, I do like gmail. Maybe 1 spam every 3 months! ;-) I use several gmail accounts, essentially one for each area of interest. I set up EACH to allow Imap. That way i can read them in thunderbird so I don't have to open a browser. My new Jesus Phone even knows how to do Gmail Imap, so I can read/post this list from anywhere. It grows on ya after a while.... -- ----------JSA--------- Someone stole my tag line, so now I have this rental. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, August 18, 2008 20:43, John Andersen wrote:
No one can tell you what to use, but if you just want to avoid installing thunderbird, why not get read the list with something that requires NO installation ANYWHERE? Like Gmail?
This is the first constructive message in the entire thread. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, August 18, 2008 05:03, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
To: Sent: Sunday, August 17, 2008 10:03 PM Subject: Re: [opensuse] OT: bash F1 On Sunday 17 August 2008 18:06, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
To: Sent: Sunday, August 17, 2008 9:03 PM Subject: Re: [opensuse] OT: bash F1 On Sunday 17 August 2008 17:18, Brian K. White wrote:
----- Original Message ----- From: "Randall R Schulz"
... Your cut command ...
You replied to my post but addressed only content from the post to which mine was a reply.
I replied to the thread.
There is no such thing as replying to a thread. You reply to a
1) Of course there is.
particular post which is part of a thread. You should choose the post to which you reply based on the content you wish to address in that reply.
Otherwise phrases like "Your cut command" seem to refer to my (Randall R. Schulz's) "cut command" when in fact I neither suggested nor stated any such command.
2) I had already deleted the original post. Ergo: see 1).
This argument is admittedly technically valid, and as such I am sorry I forgot to go up and clean off your attribution from the quoting, but then again, I didn't remove the OP's either or change the nuber of layers, so the argument is a bit weak.
Perhaps the only answer I should have offered to the charge was a simple "Yes, I did." with a "so what?" left unspoken but implied.
-- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
Isn't there an off-topic list for such very, *very* interesting meta-discussions on a rainy monday morning? </sarcasm> -- GCM d+ s+++:-- a C++++ UL++++ P--- L+++ E---- W- N+ o-- K--- w--- O- M V-- PS+ PE Y+ PGP t+ 5++ X+++ R tv- b++ DI++ D++ G e++ h--- r+++ y+++ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Your cut command looks like it's going to give you "/etc/apache2/sites" every time. You should sort your result because ls garantees no particular order unless using ie -lt which is time anyways not numerical. You don't need expr as long as you are using bash or ksh or zsh or almost anything but stock sh on sco unix or solaris.
There *shouldn't* be anything else there except sites in format like: 001-site1 002-site2 Etc.. The cut actually works OK, if it doesn't find anything, it just gives empty string which I address later on.
#!/bin/bash unalias ls ## grr F*&^* distros... A=`cd /etc/apache2/sites-enabled ;ls |cut -d- -f1 |sort -n |tail -1` A=`printf "%03i\n" $((++A))`
In ksh you don't need to spawn a sub shell just to use printf just to get it back to right-justifid, zero-padded, 3 digits. Nor do you need the subshell nor any of the processes in the backticks with ls either as long as we're making any assumptions about the filenames anyways. There is a quirk that you must start with 001 though. You can have a file 000-site0, and other files of other forms, just this script will never see those.
That's exactly what I've been looking for, somewhat, as 000-site0 should be on servers already, as it will serve default, non named-based access.
#!/bin/ksh typeset -Z3 A=001 cd /etc/apache2/sites-enabled while [ -e ${A}-* ] ;do ((++A)) ;done
In both cases $A holds the new/next value at the end echo Next site is $A
Thanks! -- Best regards, Nick Zeljkovic -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
----- Original Message -----
From: "Nick Zeljkovic"
Your cut command looks like it's going to give you "/etc/apache2/sites" every time. You should sort your result because ls garantees no particular order unless using ie -lt which is time anyways not numerical. You don't need expr as long as you are using bash or ksh or zsh or almost anything but stock sh on sco unix or solaris.
There *shouldn't* be anything else there except sites in format like: 001-site1 002-site2
Etc.. The cut actually works OK, if it doesn't find anything, it just gives empty string which I address later on.
You're right, I forgot that you were cutting the output of basename, which would have removed the "-" from earlier in the string "sites-enabled". Sorry 'bout that.
#!/bin/bash unalias ls ## grr F*&^* distros... A=`cd /etc/apache2/sites-enabled ;ls |cut -d- -f1 |sort -n |tail -1` A=`printf "%03i\n" $((++A))`
In ksh you don't need to spawn a sub shell just to use printf just to get it back to right-justifid, zero-padded, 3 digits. Nor do you need the subshell nor any of the processes in the backticks with ls either as long as we're making any assumptions about the filenames anyways. There is a quirk that you must start with 001 though. You can have a file 000-site0, and other files of other forms, just this script will never see those.
That's exactly what I've been looking for, somewhat, as 000-site0 should be on servers already, as it will serve default, non named-based access.
#!/bin/ksh typeset -Z3 A=001 cd /etc/apache2/sites-enabled while [ -e ${A}-* ] ;do ((++A)) ;done
In both cases $A holds the new/next value at the end echo Next site is $A
Thanks!
Ain't no thang. Also something to be aware of, maybe you'll consider this a feature or may consider it a problem: This will always find the next available number, not necessarily the next higher number. If you create 001 through 023, and then delete 011, the next time you run this it will give you 011, not 024. Then it would give 024 the next time after that. You could write a different while-loop that scans all possible numbers and gives you the next after the highest found: #!/bin/ksh typeset -Z3 A=001 n=001 cd /etc/apache2/sites-enabled while [ $n -le 999 ] ;do [ -e ${n}-* ] && A=$n ;((++n) ;done ((++A)) Next site is $A n loops from 001 all the way to 999. A gets updated to be a copy of n every time any file is found. At the end of the loop, A will be the same as the highest file, so we incriment A once after the loop. But that could still re-use numbers if you happen to delete numbers from the high end. If you create 001 through 023 and then delete 018 through 023, it will tell you 018 on the next run. You'd need to use a file to hold a running value to really never re-use a number. But then you don't need any counter loop any more either. #!/bin/ksh typeset -Z3 A=001 C=/etc/apache2/last-site.txt read A < $C echo $((++A)) > $C Next site is $A And this is the kind of thing where you probably should not re-use numbers, just as you should generally not delete users but instead "retire" or disable them. And whether deleted or retired, you should never re-use the UID. Make the number 6 digits and make the last-site file a single file on a single admin server and instead of "read < file" and "echo > file", create a small cgi on the central admin box that can do the incriment and re-write and echo back the number. Then have all other boxes read the number from the cgi via wget or curl or even netcat, or even the tcp features built in to bash/ksh/zsh. Sounds fancy but really it's hardly more than what you're already doing. This is all it would take: /srv/www/cgi-bin/next-site on the admin box: #!/bin/bash echo -e "content-type: text/plain\n" [ "$QUERY_STRING" = "seeqrit" ] || exit 1 c=last-site.txt [ -e $c ] || echo 0 >$c read n < $c echo $((++n)) > $c printf "%06i\n" $n On every other box you run: A=`curl -s http://adminbox/cgi-bin/next-site?seeqrit` echo Next site is $A The cgi doesn't need ksh in this case. We aren't scanning file names, and so we don't need to work with the formatted form of the number, and so the number we do math on and store in the file can be a plain integer, or a plain untyped variable. And the printf is fine for echoing it back to the client. This way handles the missing, 000000, & 000001 cases too. Now no two sites will ever use the same number across all your boxes, and no number will ever get re-used. This is much saner for accounting and administration and maintenance too like if you need to transfer a site, or all sites from one box to another, no problem, none will ever clobber any other. -- Brian K. White brian@aljex.com http://www.myspace.com/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 17 Aug 2008, Brian K. White wrote:-
Your cut command looks like it's going to give you "/etc/apache2/sites" every time.
It won't. When passed a path without wildcards, ls only returns the filenames and not the full pathname, as shown below: davjam@davids:~> ls tags do_upper_case.c Makefile shrink.o tags2.c tags2.o tags.c do_upper_case.o shrink.c tags2 tags2.c~ tags3.sh tags.sh davjam@davids:~> davjam@davids:~> ls tags/ do_upper_case.c Makefile shrink.o tags2.c tags2.o tags.c do_upper_case.o shrink.c tags2 tags2.c~ tags3.sh tags.sh davjam@davids:~> davjam@davids:~> ls tags/* tags/do_upper_case.c tags/shrink.c tags/tags2.c tags/tags3.sh tags/do_upper_case.o tags/shrink.o tags/tags2.c~ tags/tags.c tags/Makefile tags/tags2 tags/tags2.o tags/tags.sh
You should sort your result because ls garantees no particular order unless using ie -lt which is time anyways not numerical.
Erm, from "man ls" NAME ls - list directory contents SYNOPSIS ls [OPTION]... [FILE]... DESCRIPTION List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuSUX nor --sort. Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32 | | openSUSE 10.3 32b | openSUSE 11.0 32b | openSUSE 10.2 64b | openSUSE 10.3 64b | openSUSE 11.0 64b RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 17 Aug 2008, Nick Zeljkovic wrote:-
Hi Listmates,
Current code: CURNUM=`ls /etc/apache2/sites-enabled|cut -d- -f1|tail -1`
# -r allows sed to use regex in the script, # ^0+ matches any number of leading zeros CURNUM=$(ls /etc/apache2/sites-enables|cut -d- -f1|tail -1|sed -r "s#^0+##")
NEWNUM=`expr $CURNUM + 1`
# no need for expr to increment $NEWNUM NEWNUM=$(( ${CURNUM} + 1)) If CURNUM is empty, or not a number, NEWNUM will be assigned a value of "1"
NUMLEN=`expr length $NEWNUM`
No need for that line, unless you actually need $NUMLEN at some other point. If you do, you don't need to use expr: # return the length of the variable $NEWNUM NUMLEN=${#NEWNUM}
if [ -z $CURNUM ] then FID="001" elif [ $NUMLEN -eq "1" ] then FID="00$NEWNUM" elif [ $NUMLEN -eq "2" ] then FID="0$NEWNUM" elif [ $NUMLEN -eq "3" ] then FID=$NEWNUM Fi
And these can be reduced to one line: FID=$(printf "%03u" "${NEW_NUM}") Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32 | | openSUSE 10.3 32b | openSUSE 11.0 32b | openSUSE 10.2 64b | openSUSE 10.3 64b | openSUSE 11.0 64b RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sunday 17 August 2008 16:13, David Bolt wrote:
On Sun, 17 Aug 2008, Nick Zeljkovic wrote:-
Hi Listmates,
Current code: CURNUM=`ls /etc/apache2/sites-enabled|cut -d- -f1|tail -1`
# -r allows sed to use regex in the script, # ^0+ matches any number of leading zeros CURNUM=$(ls /etc/apache2/sites-enables|cut -d- -f1|tail -1|sed -r "s#^0+##")
NEWNUM=`expr $CURNUM + 1`
# no need for expr to increment $NEWNUM NEWNUM=$(( ${CURNUM} + 1))
Now you're in for BASH's interpretation of digit strings as octal numbers when the first character is a zero.
...
Regards, David Bolt
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 17 Aug 2008, Randall R Schulz wrote:-
On Sunday 17 August 2008 16:13, David Bolt wrote:
# -r allows sed to use regex in the script, # ^0+ matches any number of leading zeros CURNUM=$(ls /etc/apache2/sites-enables|cut -d- -f1|tail -1|sed -r "s#^0+##")
NEWNUM=`expr $CURNUM + 1`
# no need for expr to increment $NEWNUM NEWNUM=$(( ${CURNUM} + 1))
Now you're in for BASH's interpretation of digit strings as octal numbers when the first character is a zero.
Which won't matter because the addition of: sed -r "s#^0+##" to the initial assignment of $CURNUM should have stripped them off. Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32 | | openSUSE 10.3 32b | openSUSE 11.0 32b | openSUSE 10.2 64b | openSUSE 10.3 64b | openSUSE 11.0 64b RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
# no need for expr to increment $NEWNUM NEWNUM=$(( ${CURNUM} + 1))
If CURNUM is empty, or not a number, NEWNUM will be assigned a value of "1"
This whole messy code I came up with was due to bash not liking leading zeros for calculations. If my input of $CURNUM is "001" it will calculate it as "2" instead of "002".
NUMLEN=`expr length $NEWNUM`
No need for that line, unless you actually need $NUMLEN at some other point. If you do, you don't need to use expr:
# return the length of the variable $NEWNUM NUMLEN=${#NEWNUM}
Thanks, expr was first thing to come on my mind to do that. I need NUMLEN so I can know how many zeros to add to file identifier.
And these can be reduced to one line:
FID=$(printf "%03u" "${NEW_NUM}")
Thanks! I was missing that, seems to have done the trick replacing my checks, but something funky is going on there with numbers like 010 or anything starting with one zero: root@sgd1 [~/bin]# NEWNUM="015" root@sgd1 [~/bin]# echo $NEWNUM 015 root@sgd1 [~/bin]# printf "%03u" "${NEWNUM}" 013 Any ideas ? -- Best regards, Nick Zeljkovic -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 18 Aug 2008, Nick Zeljkovic wrote:-
And these can be reduced to one line:
FID=$(printf "%03u" "${NEW_NUM}")
Thanks! I was missing that, seems to have done the trick replacing my checks, but something funky is going on there with numbers like 010 or anything starting with one zero: root@sgd1 [~/bin]# NEWNUM="015" root@sgd1 [~/bin]# echo $NEWNUM 015 root@sgd1 [~/bin]# printf "%03u" "${NEWNUM}" 013
Any ideas ?
That's bash treating the number as octal and converting it to base 10 for you. The only way to get printf to produce a decimal number is to strip off the leading 0's. And going back, you don't really need to use the "sed" command. This should do the trick: # no need for the pipe into cut # CURNUM=$(ls /etc/apache2/sites-enables|tail -1) # force use of base 10, and strip off everything from the first - # NEWNUM=$(( 10#${CURNUM%%-*} + 1 )) # get the length of $NEWNUM, if still required # NUMLEN=${#NEWNUM} # and create a 3-digit number with leading 0's # FID=$(printf "%03u" "${NEWNUM}" Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32 | | openSUSE 10.3 32b | openSUSE 11.0 32b | openSUSE 10.2 64b | openSUSE 10.3 64b | openSUSE 11.0 64b RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (10)
-
Amedee Van Gasse
-
Brian K. White
-
David Bolt
-
John Andersen
-
Neil
-
Nick Zeljkovic
-
Patrick Shanahan
-
Philip Burness
-
Philipp Thomas
-
Randall R Schulz