?

Log in

No account? Create an account

Previous Web | Next Web

28

It's gonna get monotonous me saying this, but i'm *tired*...

Concentrating on code is *hard* and it's exhausting me *so* much...

It's not even 9:30pm and i feel like going to sleep.

I've not been working on the Database application this afternoon, although i did a little this morning... i've been trying to right a batch file in w2k's DOS shell, NT5-DOS.

Now, in good old Linux, I can do all *sorts* of wonderfully fun things in a command shell... i can do lots of things that make life easy for this kind of job... like i can tell a command to run in 5 minutes by saying

  at now + 5 minutes command

or something like that... the syntax isn't relevent, it's that +5 bit... NT and Win2K don't have that command switch... I have to do arithmetic on the time... and NT didn't used to even have arithmetic...

Atleast you can do maths in NT5-DOS, and I can access the time through an environment variable too.... which means that this is atleast *theoretically* possible... but I miss bash... I miss being able to use backticks to do things... that's useful... backticks mean execute the command in the backticks and return it's output... so you can do:

  set myVariable=`ps -ef | grep fcs | grep -v grep`

Which checks if the fcs process is running and stores the resulting output in the variable myVariable... it's *cool*.. you can do a *lot* with it... You can even do:

  set myVariable=`ps -ef | grep fcs | grep -v grep | awk { print $2 }`

Which will give you the process number of the fcs process.... and then i can do even cooler things, like

  kill -9 `ps -ef | grep fcs | grep -v grep | awk { print $2 }

Which will kill off the fcs process.

bash is just so *cool*... you can do so much stuff so easily... NT, I don't think I could even kill a process if I knew it's process id... let alone do it all automatically...

NT sux... UNIX rules :-)

OK, so i'm a geek at heart, who cares? i don't, that's for sure....

Anyway, back to the point. I'm having to *think*... not just that, i'm having to think *hard*...

ok, to prove it, to get the same functionality as "at +5 minutes command", I have to:

  • split the time into 3 variables; hours, mins and secs.

  • then i have to add 5 to the mins value.

  • then i have to check that that isn't more than 59 so i don't get 60 as a mins value...

  • now if i get over 59, i have to then minus 60 from the mins value.

  • and if i do that, i have to add 1 to the hours value.

  • now i have to check that this hasn't made hours=24.

  • if it does, i have to minus 24 from hours, so that i'm back into a real 24hour clock.

  • now i can do "at CALCdTIME command".


See? it's not quite as, *graceful*, is it?

And to make things worse, I can't just say "if mins >= 60 then set mins=mins-60)", which is what i want to do, I have to have a seperate line for each value it could be (60, 61, 62, 63 and 64), because the DOS "if" command doesn't have a numeric comparison, it only does strings.... how *stupid* is *that*???????



OK, I'm calm, promise.... I just hate that DOS is so shit. There's no excuse for it even... JP-Soft make a program called 4DOS that replaces the standard DOS prompt, and is *far* more powerful... and there's an NT version, 4NT that you can use too... the problem is you have to pay to have more than 30 days usage, and I'm trying to write a backup script that'll be in use for *years*.... While I may not quite be able to have that graceful "at +5" deal, I can certainly manage to do maths and mathematical comparisons using it....

Humph!

Micro$oft again :-(

Don't get me wrong, I *like* w2k... and that's kinda painful to say... but as far as I'm concerned, it's just not flexible enough to run key systems for small businesses... i don't *want* to have to write a *huge*, complex script to do simple things like this. Give me Linux or atleast UNIX anyday.. I mean, Solaris is nice... and BSD is supposed to be cool too... and HP was good last time I used it... even SCO is a better command line, and therefore scripting environment than windows....

And don't even *mention* the scripting host.... i'm not sure i want to put my faith in that just yet........ and anyway, i shouldn't *have* to add on an extra software component to do this stuff...



OK, moaning over. promise.

i'm gonna go cook the rest of my dinner... roast chicken, jacket potato and veg i think....

Cya

   L
     M
   *   G