Hi Below if $remaining is empty i want the if to finish - what is it i need to put in SOMETHING? if [ "$remaining" = "" ] ; then SOMETHING ; else kill -9 $remaining fi thanks?
On Fri, Feb 27, 2009 at 11:14:01AM +0000, Tom Brown wrote:> > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fiif [ "${remaining}" != "" ] ; then kill -9 ${remaining} fi John -- "I''m sorry but our engineers do not have phones." As stated by a Network Solutions Customer Service representative when asked to be put through to an engineer. "My other computer is your windows box." Ralf Hildebrandt <sxem> trying to play sturgeon while it''s under attack is apparently not fun. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.centos.org/pipermail/centos/attachments/20090227/36f95be5/attachment.bin
Tom Brown wrote:> Hi > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fiif [ "x${remaining}" != "x" ] ; then kill -9 ${remaining} fi Ralph -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.centos.org/pipermail/centos/attachments/20090227/4ba8e330/attachment.bin
You have to put in NOTHING, i.e.: if [ "$remaining" = "" ] ; then ; else kill -9 $remaining fi A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://www.brainyquote.com/quotes/authors/m/muhammad_ali.html http://www.brainyquote.com/quotes/authors/e/emma_goldman.html http://www.brainyquote.com/quotes/authors/m/michelangelo.html W. C. Fields - "I never drink water because of the disgusting things that fish do in it." On Fri, Feb 27, 2009 at 12:14 PM, Tom Brown <tom at ng23.net> wrote:> Hi > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fi > > thanks? > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.centos.org/pipermail/centos/attachments/20090227/bc3418eb/attachment.html
I normally do it this way: if (length($remaining) == 0) { &do_exit; } Per Hi Below if $remaining is empty i want the if to finish - what is it i need to put in SOMETHING? if [ "$remaining" = "" ] ; then SOMETHING ; else kill -9 $remaining fi
On Fri, 2009-02-27 at 11:14 +0000, Tom Brown wrote:> Hi > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fiif [ -n "$remaining" ] ; then kill -9 $remaining fi Man bash, look for builtin "test" and find a bunch of tests defined there. Keep in mind that "test" and "if [ ... ]" are equivalent in bash. I don''t know how much other code surround this, but I deduce (admittedly incomplete information) that you have a reducing list operation going? If so, maybe something like # Initialize remaing list and then set "$remaining" # If empty $1 is null while [ -n "$1" ] ; do echo "$1" # remove this kill -9 $ shift done $ remaining="9997 9998 9999" $ while [ -n "$1" ] ; do> echo "$1" > shift > done9997 9998 9999> > thanks? > <snip sig stuff>HTH -- Bill
Hi My problem is related to clientless authentication for printing. We are evaluating if it''s worth the trouble on centos. Uppgrading cups is not a problem That i have already solved. Further research also states that kerberos have to be version 1.6.3. This is a big problem. Neither centos 4 nor centos 5 have the required version of kerberos. Compiling my own compile kerberos is not something i want to do! Is it worth it or even possible to upgrade kerberos to 1.6.3 or will we most likely break something else with an upgrade?? No rpms are available and i suppose there''s a reason for that. There''s no problem compiling cups or kerberos on both platforms. I just wanna find out if it is worth the trouble we will get or if it''s possible/recommended to do it?!?!. Best Regards, Thomas References;;; From cups web page.... Using Kerberos Authentication CUPS 1.3 adds Kerberos support which allows you to use a Key Distribution Center (KDC) for authentication on your local CUPS server and when printing to a remote authenticated queue. This document describes how to configure CUPS to use Kerberos authentication and provides helpful links to the MIT help pages for configuring Kerberos on your systems and network. http://www.cups.org/documentation.php/kerberos.html System Requirements The following are required to use Kerberos with CUPS: Heimdal Kerberos (any version) or MIT Kerberos (1.6.3 or newer)
> <snip>> # Initialize remaing list and then > set "$remaining" # If empty $1 is null > while [ -n "$1" ] ; do > echo "$1" # remove this > kill -9 $s/\$/$1/ # OOPS!> shift > done > > $ remaining="9997 9998 9999" > $ while [ -n "$1" ] ; do > > echo "$1" > > shift > > done > 9997 9998 9999 > > > > > thanks? > > <snip sig stuff> > > HTH-- Bill
You don''t really need to prepend the x if the $remaining is in quotes, do you? If you didn''t use quotes, then you could end up with a error if $remaining isn''t set. On Feb 27, 2009, at 5:24 AM, Ralph Angenendt wrote:> Tom Brown wrote: >> Hi >> >> Below if $remaining is empty i want the if to finish - what is it i >> need >> to put in SOMETHING? >> >> if [ "$remaining" = "" ] ; then >> SOMETHING ; >> else >> kill -9 $remaining >> fi > > if [ "x${remaining}" != "x" ] ; then > kill -9 ${remaining} > fi > > Ralph > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos
On Fri, Feb 27, 2009 at 11:14:01AM +0000, Tom Brown wrote:> Hi > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fiA ":" on it''s own will do what you want. if [ "$remaining" = "" ] then : else kill -9 $remaining fi But better would be if [ -n "$remaining" ] then kill -9 $remaining fi -- rgds Stephen
Kevin Krieser wrote:> You don''t really need to prepend the x if the $remaining is in quotes, > do you? If you didn''t use quotes, then you could end up with a error > if $remaining isn''t set.Probably. It''s just something I''m used to do :) Cheers, Ralph -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.centos.org/pipermail/centos/attachments/20090227/3e60db80/attachment.bin
> A ":" on it''s own will do what you want. > > if [ "$remaining" = "" ] > then > : > else > kill -9 $remaining > fi > > But better would be > > if [ -n "$remaining" ] > then > kill -9 $remaining > fi > >thanks to all for the suggestions
On Fri, 2009-02-27 at 15:42 +0100, Ralph Angenendt wrote:> Kevin Krieser wrote: > > You don''t really need to prepend the x if the $remaining is in quotes, > > do you? If you didn''t use quotes, then you could end up with a error > > if $remaining isn''t set. > > Probably. It''s just something I''m used to do :)It could be considered "good style" because it establishes a "habit" that covers for occassional "brain farts". Also helps n00bs avoid delays for debugging when they jump in and start coding under pressure. The downside risk is that habit might bite one when they do do something like "-n" and forget to remove the "x". <*sigh*> Habitual humons have hard hits however hard they try.> > Cheers, > > Ralph > <snip sig stuff>-- Bill
on 2-27-2009 3:32 AM ? spake the following:> You have to put in NOTHING, i.e.: > > if [ "$remaining" = "" ] ; then > ?? ? ? ? ? ; > ? ? ? ?else > ? ? ? ? ? ?kill -9 $remaining > fi > > > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing in e-mail? > > > > http://www.brainyquote.com/quotes/authors/m/muhammad_ali.html > > http://www.brainyquote.com/quotes/authors/e/emma_goldman.html > > http://www.brainyquote.com/quotes/authors/m/michelangelo.html > > > > > W. C. Fields ?- "I never drink water because of the disgusting things > that fish do in it." > > On Fri, Feb 27, 2009 at 12:14 PM, Tom Brown > <tom at ng23.net > <mailto:tom at ng23.net>> wrote: > > Hi > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > ? ? ? ? ? ?SOMETHING ; > ? ? ? ?else > ? ? ? ? ? ?kill -9 $remaining > fi >Why do you top post when you have a signature that denounces it as evil? This is not to start a war about top posting, it is just a post about hypocrisies, which is even less tolerable. -- MailScanner is like deodorant... You hope everybody uses it, and you notice quickly if they don''t!!!! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 258 bytes Desc: OpenPGP digital signature Url : http://lists.centos.org/pipermail/centos/attachments/20090227/30c9e492/attachment.bin
On Fri, Feb 27, 2009 at 5:03 AM, Thomas Johansson <thomasj at isy.liu.se> wrote:> Hi > > My problem is related to clientless authentication for printing. We are > evaluating if it''s worth the trouble on centos. Uppgrading cups is not a > problem That i have already solved. Further research also states that > kerberos have to be version 1.6.3. This is a big problem. Neither centos > 4 nor centos 5 have the required version of kerberos. Compiling my own > compile kerberos is not something i want to do! > > Is it worth it or even possible to upgrade kerberos to 1.6.3 or will we > most likely break something else with an upgrade?? No rpms are available > and i suppose there''s a reason for that. There''s no problem compiling > cups or kerberos on both platforms. I just wanna find out if it is worth > the trouble we will get or if it''s possible/recommended to do it?!?!.Upgrading kerberos on CentOS systems is not a trivial task. Kerberos is a basic component for a lot of packages which requires a large dependency chain. I would look at it as follows: 1) CentOS-4/5 do not have kerberos needed. 2) Fedora-10/11 does have the kerberos needed. 3) CentOS-6 might be based off of Fedora-11. Build your proof of concept project with Fedora-10 with a plan of rebuilding the system after CentOS-6 comes out. Then you have both an immediate win and a long term plan on how to reach a stable product. Hope that helps.> Best Regards, > Thomas > > > References;;; > ?From cups web page.... > > Using Kerberos Authentication > CUPS 1.3 adds Kerberos support which allows you to use a Key > Distribution Center (KDC) for authentication on your local CUPS server > and when printing to a remote authenticated queue. This document > describes how to configure CUPS to use Kerberos authentication and > provides helpful links to the MIT help pages for configuring Kerberos on > your systems and network. > > http://www.cups.org/documentation.php/kerberos.html > System Requirements > The following are required to use Kerberos with CUPS: > Heimdal Kerberos (any version) or MIT Kerberos (1.6.3 or newer) > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- Stephen J Smoogen. -- BSD/GNU/Linux How far that little candle throws his beams! So shines a good deed in a naughty world. = Shakespeare. "The Merchant of Venice"
Stephen John Smoogen wrote:> On Fri, Feb 27, 2009 at 5:03 AM, Thomas Johansson <thomasj at isy.liu.se> wrote: > >> Hi >> >> My problem is related to clientless authentication for printing. We are >> evaluating if it''s worth the trouble on centos. Uppgrading cups is not a >> problem That i have already solved. Further research also states that >> kerberos have to be version 1.6.3. This is a big problem. Neither centos >> 4 nor centos 5 have the required version of kerberos. Compiling my own >> compile kerberos is not something i want to do! >> >> Is it worth it or even possible to upgrade kerberos to 1.6.3 or will we >> most likely break something else with an upgrade?? No rpms are available >> and i suppose there''s a reason for that. There''s no problem compiling >> cups or kerberos on both platforms. I just wanna find out if it is worth >> the trouble we will get or if it''s possible/recommended to do it?!?!. >> > > Upgrading kerberos on CentOS systems is not a trivial task. Kerberos > is a basic component for a lot of packages which requires a large > dependency chain.We noticed that. Several pages of dependencies if one make a yum remove of krb5-workstation. I''m really dont want to try upgrading. Its more like i''m looking for arguments against such a crazy thing.> I would look at it as follows: > > 1) CentOS-4/5 do not have kerberos needed. > 2) Fedora-10/11 does have the kerberos needed. > 3) CentOS-6 might be based off of Fedora-11. > > Build your proof of concept project with Fedora-10 with a plan of > rebuilding the system after CentOS-6 comes out. Then you have both an > immediate win and a long term plan on how to reach a stable product. > > Hope that helps. >We have figured it out that far. On platforms like Solaris, ubuntu Fedora and others we have no problem printing. The problem is that we have a lot of software that require both centos 5 and centos 4. Cannot abandon centos for those clients. Also, the print project is a solution offered/pushed to us. Obviously we cannot use it on centos. They (the project leaders) have to choose another solution for centos. That will be the answer to the project leaders. Thanks for the answer
On Fri, Feb 27, 2009 at 12:27 PM, Thomas Johansson <thomasj at isy.liu.se> wrote:> Stephen John Smoogen wrote: >> On Fri, Feb 27, 2009 at 5:03 AM, Thomas Johansson <thomasj at isy.liu.se> wrote: >> >>> Hi >>> >>> My problem is related to clientless authentication for printing. We are >>> evaluating if it''s worth the trouble on centos. Uppgrading cups is not a >>> problem That i have already solved. Further research also states that >>> kerberos have to be version 1.6.3. This is a big problem. Neither centos >>> 4 nor centos 5 have the required version of kerberos. Compiling my own >>> compile kerberos is not something i want to do! >>> >>> Is it worth it or even possible to upgrade kerberos to 1.6.3 or will we >>> most likely break something else with an upgrade?? No rpms are available >>> and i suppose there''s a reason for that. There''s no problem compiling >>> cups or kerberos on both platforms. I just wanna find out if it is worth >>> the trouble we will get or if it''s possible/recommended to do it?!?!. >>> >> >> Upgrading kerberos on CentOS systems is not a trivial task. Kerberos >> is a basic component for a lot of packages which requires a large >> dependency chain. > We noticed that. Several pages of dependencies ?if one make a yum remove > of krb5-workstation. I''m really dont want to try upgrading. Its more > like i''m looking for arguments against such a crazy thing. > >> I would look at it as follows: >> >> 1) CentOS-4/5 do not have kerberos needed. >> 2) Fedora-10/11 does have the kerberos needed. >> 3) CentOS-6 might be based off of Fedora-11. >> >> Build your proof of concept project with Fedora-10 with a plan of >> rebuilding the system after CentOS-6 comes out. Then you have both an >> immediate win and a long term plan on how to reach a stable product. >> >> Hope that helps. >> > We have figured it out that far. On platforms like Solaris, ubuntu > Fedora and others we have no problem printing. The problem is that we > have a lot of software that require both centos 5 and centos 4. Cannot > abandon centos for those clients. Also, the print project is a solution > offered/pushed to us. Obviously we cannot use it on centos. They (the > project leaders) have to choose another solution for centos. That will > be the answer to the project leaders.A last set would be to have a seperate set of kerberos Libraries and statically compile the cups you want against those. Its an ugly hack but works in those cases. -- Stephen J Smoogen. -- BSD/GNU/Linux How far that little candle throws his beams! So shines a good deed in a naughty world. = Shakespeare. "The Merchant of Venice"
Stephen John Smoogen wrote:> On Fri, Feb 27, 2009 at 12:27 PM, Thomas Johansson <thomasj at isy.liu.se> wrote: > >> Stephen John Smoogen wrote: >> >>> On Fri, Feb 27, 2009 at 5:03 AM, Thomas Johansson <thomasj at isy.liu.se> wrote: >>> >>> >>>> Hi >>>> >>>> My problem is related to clientless authentication for printing. We are >>>> evaluating if it''s worth the trouble on centos. Uppgrading cups is not a >>>> problem That i have already solved. Further research also states that >>>> kerberos have to be version 1.6.3. This is a big problem. Neither centos >>>> 4 nor centos 5 have the required version of kerberos. Compiling my own >>>> compile kerberos is not something i want to do! >>>> >>>> Is it worth it or even possible to upgrade kerberos to 1.6.3 or will we >>>> most likely break something else with an upgrade?? No rpms are available >>>> and i suppose there''s a reason for that. There''s no problem compiling >>>> cups or kerberos on both platforms. I just wanna find out if it is worth >>>> the trouble we will get or if it''s possible/recommended to do it?!?!. >>>> >>>> >>> Upgrading kerberos on CentOS systems is not a trivial task. Kerberos >>> is a basic component for a lot of packages which requires a large >>> dependency chain. >>> >> We noticed that. Several pages of dependencies if one make a yum remove >> of krb5-workstation. I''m really dont want to try upgrading. Its more >> like i''m looking for arguments against such a crazy thing. >> >> >>> I would look at it as follows: >>> >>> 1) CentOS-4/5 do not have kerberos needed. >>> 2) Fedora-10/11 does have the kerberos needed. >>> 3) CentOS-6 might be based off of Fedora-11. >>> >>> Build your proof of concept project with Fedora-10 with a plan of >>> rebuilding the system after CentOS-6 comes out. Then you have both an >>> immediate win and a long term plan on how to reach a stable product. >>> >>> Hope that helps. >>> >>> >> We have figured it out that far. On platforms like Solaris, ubuntu >> Fedora and others we have no problem printing. The problem is that we >> have a lot of software that require both centos 5 and centos 4. Cannot >> abandon centos for those clients. Also, the print project is a solution >> offered/pushed to us. Obviously we cannot use it on centos. They (the >> project leaders) have to choose another solution for centos. That will >> be the answer to the project leaders. >> > > A last set would be to have a seperate set of kerberos Libraries and > statically compile the cups you want against those. Its an ugly hack > but works in those cases. >Excellent tip! We completely missed that. Have now compiled and tested this on one client. It works! Thanks a lot! Now to the formalities.. My apoligies for kidnapping a thread! A mistake that will not happen again..