Saturday, March 22nd, 2014

sanguine / livid

Saturday, March 22nd, 2014 08:59 am
darkoshi: (Default)
A word that doesn't mean what I thought it meant. (I thought it meant contentedly calm and relaxed.)

sanguine - (adj.) cheerfully optimistic, hopeful, or confident.


As long as I consider that the word etymology is based on blood / redness, I should be able to remember that it doesn't mean calmness. But when I think of being red in the face, I think of rage (the opposite of calm contentedness), not cheerfulness, which is why I probably have a hard time remembering the correct meaning.

livid - ((adj.) enraged; furiously angry) is another word like that, the definition of which I generally do get right. It can also mean "reddish or flushed". Yet the first definition is "having a discolored, bluish appearance caused by a bruise", and I don't associate blue-ness with rage.

bah bah batch file

Saturday, March 22nd, 2014 04:45 pm
darkoshi: (Default)
Trying to figure out how to get the logic in a big Windows batch file to work right is about driving me crazy.

I keep running up against walls for the things that ought to be *simple*.
Like echoing a variable value.
Like comparing a variable to another value.

Sheeesh!

Consider the following.
-----------------------

for /f "tokens=1,2*" %%a in (tmp.txt) do (

SET var1=%%a
SET var2=%%b
SET var3=%%c

echo %%c xxx

setlocal enableDelayedExpansion

echo !var3!
echo "!var3!"
)
------------------------

Why does the 1st ECHO statement display an output with the 'xxx' *before* and partially *overlaying* the value that was read from the file, like this???
xxxIYUIYOIYI

The 2nd ECHO statement displays the correct value.

The 3rd ECHO statement displays the first double-quote character, then the correct variable value. But it doesn't display the 2nd double-quote character. WHY NOT??? How can I figure out if there are spaces on the end, if it doesn't let me display anything after it??

Heaven forbid what I really want to do is like this:
IF "!var3:~19!" == " " call :someOtherFunction
or like this:
IF "!var3:~-2!" == " " call :someOtherFunction


How can I figure out why the If statements aren't working, if I can't even get a simple ECHO to work right?

If I replace the double quote chars in the ECHO statement with some other chars, it still has the same problem.

It doesn't help that I was up til 2am working on this batch file last night, and was only able to get 5.5 hours sleep. Due to waking up early and not being able to fall back asleep.
On top of having woken up 1.5 hours early yesterday morning.

July 2025

S M T W T F S
  1234 5
6 789101112
13 14 15 16171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Friday, July 25th, 2025 11:10 am
Powered by Dreamwidth Studios