discussion. toch nen nest GEEKS bijeen ginder op #linuxhelp
[04:54PM]<tbone> hello, is there a way to do case insensitive string
comparison in bash if [ ] statements ?
[04:54PM]<nikrim> tbone id convert both stings to lower or uppercase
[04:54PM]<nikrim> then compare
[04:55PM]<tbone> yeah, how ?
[04:55PM]<nikrim> now come on
[04:55PM]<nikrim> what do u think i am a guru
[04:55PM]<tbone> dont know any comand for that
[04:55PM]<tbone> or I gotta quickly code one in c
[04:55PM]<mako-sama> nikrim, read the bash howto :/
[04:55PM]<chimon_> tbone use tr
.-Ä signoff: Retal-/#linuxhelp (Ping timeout: 240 seconds)
[04:55PM]<tbone> tr.... k thx
[04:56PM]<mako-sama> errr
[04:56PM]<mako-sama> nikrim, that was for tbone :b
[04:56PM]<tbone> mako-sama as far as I know there is no bash thing to do
string translations
[04:57PM]<chimon_> tbone incorrect, there are plenty
[04:57PM]<mako-sama> tbone, bash is superb in string translations
[04:57PM]<tbone> well you cant know everything right
[04:57PM]<chimon_> usage of tr: t="hello MoRoN" && s="`echo $t | tr [a\-z]
[A\-Z]`" && echo $s
[04:58PM]<tbone> Isee
[04:58PM]<chimon_> usage of string translations and changes: t="hello MoRoN"
&& s="`echo $t | tr [a\-z] [A\-Z]`" && echo ${s% *}
[04:58PM]<drzib> tbone- make a perl command in a -c "" or whatever it is
[04:58PM]<nighty5> avoid bash programming if possible, stick with something
more standard
.-Ä netsplit detected: efnet.cs.hut.fi split from irc.banetele.no [04:59pm]
.-Ä BitchX: Press ^F to see who left to change to [efnet.cs.hut.fi]
[04:59PM]<drzib> like PERL! boo ya
[04:59PM]<chimon_> you could probably get away with using bash's
/pattern/string/ in variables
.-Ä mode/#LINUXHELP [-b RAIN*E!*@*] by Phaid
[04:59PM]<nighty5> tr would be an acceptable solution
[04:59PM]<chimon_> however, bash can not and -will- not ever do variable
interpolation, so, if you need that, then yes, using a
programming language
.-Ä the time is now 05:00pm.
[05:00PM]<tbone> I'd say writing some quick stdin2stdou ucase and lcase
commands would be easier
[05:00PM]<tbone>
[05:00PM]<chimon_> heck, make an alias for that
[05:01PM]<tbone> OR, I could tell the users only to use lcase lol
[05:01PM]<nighty5> chimon_: bash can do variable interpolation
[05:01PM]<mako-sama> converting everything to lcases will be much easier than
trying to talk with users
[05:02PM]<nighty5> you'd effectively dump it to the shell and grab your result
and save it to a variable
[05:02PM]<chimon_> nighty5 thats not interpolation then, thats spawning
[05:02PM]<nighty5> i guess it depends what you mean
[05:02PM]<nighty5> yes, strictly speaking thats right
[05:03PM]<nighty5> but there is more than one way to roast a kangaroo
[05:04PM]<mako-sama> yeah
.-Ä mode/#LINUXHELP [-b *!*@*.bb.online.no] by Pythian
[05:04PM]<mako-sama> you'll have to catch it first anyway
.-Ä Retal- [~retal@66.90.81.227] has joined #linuxhelp
.-Ä signoff: nighty5/#linuxhelp (Remote host closed the connection)
[05:05PM]<chimon_> anyhoooo
[05:05PM]<chimon_> tbone use functions, eg: function lc { echo "$1" | tr
[A\-Z] [a\-z]; }
[05:06PM]<tbone> yup, done it like that
[05:06PM]<chimon_> although personally, i wouldnt obscure the code into one of
those, but, again, thats jst me and my personal preference
.-Ä henryx [henry@adsl-168-89-22-3.trd.kabelco.net] has joined #linuxhelp
[05:06PM]<tbone> I also wrote this : while(!feof(stdin))
[05:06PM]<tbone> fputc(tolower(fgetc(stdin)),stdout);
[05:06PM]<tbone> in C. does the same thing
[05:06PM]<tbone> so I can just call it from the system
[05:06PM]<chimon_> indeed, except that would require a spawn, whereas the
builtin function wouldnt
.-Ä signoff: S_L/#linuxhelp (Remote host closed the connection)
[05:06PM]<tbone> hehe
[05:07PM]<tbone> I guess this is all about ethics
[05:07PM]<chimon_> not really, whichever works for you - works. *shrugs
politely* i know how i would do it, but thats probably not
the same as you would do it.
.-Ä rendel [slop@80.Red-217-127-255.pooles.rima-tde.net] has joined #Linuxhelp
[05:07PM]<chimon_> personally, i wouldnt touch C++ if you paid me
[05:08PM]<tbone> lol
[05:08PM]<tbone> well... talking about standards...
[05:08PM]<chimon_> i jst can NOT stand 'MI'. its a horrible, horrible idea.
horrible.
[05:08PM]<mako-sama> MI ?
[05:08PM]<chimon_> Multiple Inheritance.
.-Ä Banky_B [~har@240.80-202-136.nextgentel.com] has joined #LINUXHELP
[05:09PM]<mako-sama> ah
[05:09PM]<mako-sama> nor do I ;/
[05:09PM]<mako-sama> but you can use C++ without MI ;/
[05:09PM]<Banky_B> somebosy here that could help me abuot how to get into
other computers on the network with linux? (no, i dont know
very much about linux...
)
[05:10PM]<Banky_B> just started with it a few days ago...
[05:10PM]<chimon_> well, -i- can, but in any 'multi-person' enviroment, it
enz enz . dei maanen emmen dor dus nog en kotier zitten over zeveren....