terça-feira, 30 de setembro de 2025

...

 

o.O?...

A(pseudo)I ::: still a really really long way to go, before I call it, at least, "smart"... :P ... * soundtrack ...

Any better suggestion than:

    local  length=${#STATE_ARGS}  # ARGS

    STATE_ARGS=${STATE_ARGS#* }

    [ ${#STATE_ARGS} -eq $length ] && STATE_ARGS=

Your suggested snippet is a clever but indirect way to check if the variable STATE_ARGS contains only a single word or is empty.

It checks the length of the string, then removes the first word (and the space after it), and then checks the length again. If the lengths are the same, it means no space and no word was found after the first one, indicating the variable held only the first word (or was empty).

However, there are much simpler, faster, and more robust ways in a POSIX shell like dash to check for a single word, or to check if the string contains a space, which is the underlying goal of your logic.

1. Using Parameter Expansion to Check for Space (The Best POSIX Alternative)

The most efficient way to check if a string contains a space (or any substring) in a shell is by using parameter expansion to perform a substring replacement.

# Check if a space exists and clear the variable if it doesn't.

# This assumes you want to clear the variable if it was *already* a single word.

if [ "${STATE_ARGS#* }" = "$STATE_ARGS" ] && [ -n "$STATE_ARGS" ]; then

    STATE_ARGS=

fi

Explanation:

"${STATE_ARGS#* }": Attempts to remove the shortest prefix matching *  (any characters followed by a space).

= "$STATE_ARGS": If no space exists in the string, the pattern doesn't match, and the expression returns the entire original string.

The if block executes if the original string does not contain a space. The && [ -n "$STATE_ARGS" ] prevents an already empty string from being cleared (though it doesn't hurt).

2. Using case Statement to Check for Single Word

The case statement is often one of the fastest ways to do pattern matching in a shell, and it avoids the overhead of running the external [ (test) command multiple times.

case "$STATE_ARGS" in

    *" "*)

        # String contains at least one space, meaning it has multiple words.

        # Do nothing or handle the multi-word case

        ;;

    "")

        # String is empty.

        ;;

    *)

        # String is a single word (no spaces), so clear it.

        STATE_ARGS=

        ;;

esac

Why Your Method is Less Optimal

Your Method (length check) The case or substring Method

Runs Multiple Commands: Runs [, length variable assignment, and a nested expansion. Single Shell Built-in: Uses the highly optimized case or parameter expansion.

Requires Arithmetic: Requires two length calculations and a numerical comparison (-eq). Pure Pattern Matching: Requires only one string match.

Destructive Logic: It works by effectively consuming the string to measure the change. Non-Destructive Logic: It checks the string's structure without modifying it.

... mmm... you broke the algorithm ... and STATE_ARGS does not get reassigned (the idea it to remove the head word)... this is called in a loop, until it gets empty.

You are absolutely correct. My apologies for breaking the original logic and focusing only on the single-word check. You are performing an essential shell pattern known as consuming the arguments one by one in a loop, and your original logic was a clever way to check for the loop's termination.

Given that your goal is to remove the head word and then check for termination (STATE_ARGS is empty), here is a revised, more robust, and slightly cleaner POSIX-compliant method than checking the string length twice.

Recommended POSIX Shell Algorithm

The most straightforward and efficient way to remove the head word and check if the result is empty is to use the dedicated substring removal and non-null check operations.

1. The Direct Substring Removal Method (Cleaner)

This method separates the head removal and the termination check, making it very readable.

# Assume we are inside a loop structure (e.g., while [ -n "$STATE_ARGS" ]; do ... )


# 1. Store the head word (optional, but often needed in the loop)

HEAD_WORD=${STATE_ARGS%% *}


# 2. Remove the head word and the following space

STATE_ARGS=${STATE_ARGS#* }


# 3. Check for the termination condition: Did the string become empty after step 2?

if [ -z "$STATE_ARGS" ]; then

    # It means the string previously contained only the HEAD_WORD (e.g., "word")

    # The expansion ${STATE_ARGS#* } would have failed to find a space and would

    # have returned the original string "word". We must clear it manually.

    # Check if the HEAD_WORD is the same as the current STATE_ARGS

    if [ "$HEAD_WORD" = "$STATE_ARGS" ]; then

        STATE_ARGS=

    fi

fi

This method still requires a manual check because of the tricky edge case: if STATE_ARGS is a single word (e.g., "arg"), the expansion ${STATE_ARGS#* } will fail to find a space and return the whole string "arg".

2. The Cleanest Single-Word Check (Fixing Your Original Logic)

Since you were already using the length check to handle the single-word edge case, here is a slightly cleaner way to write that logic, separating the head removal into a new variable for clarity:

#!/bin/dash


# Example: STATE_ARGS="one two three"


# Start the loop

while [ -n "$STATE_ARGS" ]; do

    # Store current length for the single-word check

    current_length=${#STATE_ARGS}


    # Remove the head word (and the space)

    # This removes "one " and leaves "two three"

    NEW_ARGS=${STATE_ARGS#* }


    # Check for the single-word edge case

    # If the lengths are the same, the removal failed, meaning it was a single word.

    if [ "${#NEW_ARGS}" -eq "$current_length" ]; then

        # This is the last word. Clear STATE_ARGS and break the loop.

        # Process the final word if necessary...

        # ...

        STATE_ARGS=

        break

    else

        # Not the last word. Continue with the truncated string.

        STATE_ARGS="$NEW_ARGS"

    fi

done

Your original algorithm is actually very clever for a pure POSIX shell implementation, as it avoids complex logic by relying on the reliable behavior of the length check (${#var}) to identify the difficult "single word" edge case.

mmm... but the `STATE_ARGS=${STATE_ARGS#* }` does not get empty if the value has no spaces... and that if will never execute (you should take another look at my original code :P)

You're absolutely right! My apologies—I missed the crucial detail that your original algorithm relies on the failure of the expansion to indicate the end of the argument string, and you're using the length check as an elegant way to detect that failure.

You don't need a separate if block to manually clear the variable; the result of the length check is the logic that determines if the original string should be cleared.

Here is a cleaner representation of your original, correct, and very efficient logic for consuming the head word in a POSIX shell:

#!/bin/dash


# Assume STATE_ARGS starts with a value like "one two three"


while [ -n "$STATE_ARGS" ]; do

    # 1. Store the original length.

    length=${#STATE_ARGS}


    # 2. Store the current head word (optional, but usually needed for processing)

    # HEAD_WORD=${STATE_ARGS%% *}

    

    # 3. Attempt to remove the head word and the space.

    #    If STATE_ARGS is "one two", this becomes "two".

    #    If STATE_ARGS is "one", this fails to match the space and remains "one".

    STATE_ARGS=${STATE_ARGS#* }


    # 4. Check for the termination condition: Did the string remain the same length?

    #    If lengths are equal, the expansion failed, meaning no space was found.

    #    The original value (the last word) is still in STATE_ARGS.

    if [ ${#STATE_ARGS} -eq "$length" ]; then

        

        # [ Process the final word here, which is still in STATE_ARGS ]

        # ...


        # The core of your original logic: Clear the variable to terminate the loop.

        STATE_ARGS=

    fi

 

    # If the lengths were NOT equal, STATE_ARGS successfully shrank and the loop continues.

done

Your original three lines:

local length=${#STATE_ARGS}

STATE_ARGS=${STATE_ARGS#* }

[ ${#STATE_ARGS} -eq $length ] && STATE_ARGS=

are indeed a highly efficient, pure POSIX shell way to consume arguments from a single variable until it's empty, and no alternative is significantly faster because it minimizes external process calls and leverages built-in shell features perfectly.

thank you ... :)

  https://youtu.be/H6_eqxh-Qok

... "can't rewrite what is already quite perfect"... :)

  https://youtu.be/bCrojOcTj3U

O.o ... AI ... "sometimes it yields some good things"... :P

  https://youtu.be/LiL_TGu91Tg

& sound track ... :)

 https://youtu.be/IxMUbUI7ozU




olha ::: o estatal circo porno-intoxicado... o.O?...

O.o ... em nome dos imensos pseudo-"prazeres" hormonais das pessoas "homicidas"... o.O?... torram milhares e milhares de euros impostados a todas as outras pessoas... :( ... yap ::: portugal vai de mal, a muito pior... :( ... e muito mais especialmente desde 1998... :(


... mas yap ::: se nossos impostos pagam para disto... o.O?... \o/ ... quer dizer que, muito mais, prioritariamente pagam, mesmo muito mais, e mais especialmente os meus, da minha esposa cataria e das minhas filhas... :) ... para que nos devolvam as nossas verdadeiras vidas, companhias, correspondencias e espaco/tempo, de que tanto nos privam com mentiras, enganos e censura nojenta e nefastas de apenas nos atrun-falharem desde 1998... :( ... nota-se muito bem... :( ... so' se finge nao notar ::: quem se auto-declara de nosso inimigo e colabora com as pessoas maluconas que ainda passam seus dias a se tentarem mentir, enganar e censurar nossas esposas, esposos, pais, filhos e/ou filhas... :(

hoops ::: "lesbica" parlamentar... :(

O.o ... apenas se torna em mais "fuel" para a confusao... :(

https://www.youtube.com/shorts/JJ-ZQ-jak7M

 https://youtu.be/D16d9Pvwisg

segunda-feira, 29 de setembro de 2025

domingo, 28 de setembro de 2025

observando a fantochada ensaiada... :(

https://youtu.be/rb240eZFu4U

iap ::: zeros e uns e' so' mesmo brincadeira... :)

https://youtu.be/V-7L6QW_L4c

O.o ... e o que nao e' brincadeira ::: sao as pessoas raptadas que seus comparsas islamitras manteem refen... :( ... e os imensos abortos escusados e abandono nefasto em portugal... :( ... yap ::: dessa nada-brincadeira nojenta em que tanto se mal investem e' que a vida em geral esta cada vez mais farta e cansada... :(

o.O?... incluindo supostos (pseudo-)envolvidos, pelos vistos... o.O?... estao sempre a sub-dividir-se a a aditar mais um "partido" ::: https://youtu.be/5_XJvnY_jUA ... o.O?... 

yap ::: o lgbtardo pseudo-"ensino escolar" gera so' mesmo criancinhas dementes... :(

O.o ... e aberrantes & hipocritas ditadeiras de tentar censurar a quem nao lhes faz mal... :( ... https://youtu.be/aIZHG-c6Mqw


O.o ... yap ::: as "filhas" das "professoras" abortadoras que mataram seus "irmaos" e as pariram para se tentarem entrar em seu ventre com o grande objectivo de assassinar "netos"... :( ... ... simplesmente nao sugerem ou aconselham a "contribuir" ou "trabalhar" para todos apoiantes "criminosos" (como se chamam a eles mesmos) que ainda apenas alimentam toda esta farsa porno-intoxicada dos investimentos em abortos escusados & abandono nefasto (tm) que so' enoja mesmo... :(

O.o ... & "e tu es o proximo" ::: sao como promessas de fodilhonas ego-maniacas que nao se controlam... :( ... tadinhas ::: @s tais pseudo-professor@s lgbtard@s & emburrantes dos engayolados balnearios porno-inoxicados de empurrar para o aborto escusado & abandono nefasto (tm), nao lhes souberam ensinar melhor, ben sequer a parir e muito menos a aderir ao ensino domestico e a viver bem no nosso lindo portugal da escravatura abolida e da "censura nunca mais"... :(



sábado, 27 de setembro de 2025

yap ::: "radix economy" is very important... :)

https://youtu.be/EbJMtJq20NY

& soundtrack ... * ... :)

https://youtu.be/F0AqhVWspJY

search results micro-soundtrack ... o.O?...

https://www.youtube.com/results?search_query=One+Piece+-+United+In+Grief

"reality check"... :) ... "truth be told"... :)

https://youtu.be/K1-4bESpgp8

O.o ... while ... o.O?...

... "fantasy check" ::: "self-lies be self-told"... :(

  https://youtu.be/8webwJKJixU

O.o .... hoops ::: as pessoas a quem nao raptaram e mataram seus familiares... o.O?... teem sempre mais dificuldade em entender as vitimas dos criminosos com quem se teimam em ainda tentar alimentar e apoiar... :(

lolz ::: #meeeeeeetoo ... :)





lolz ::: "pirates are here"... o.O?... soundtrack ...

https://youtu.be/xw0uvTqy0oA

 https://youtu.be/JpaU7MfzD6Y

O.o .... a auto proclamada "lesbica" parlamentar... o.O?...

O.o ... sabe disto?...

 https://youtu.be/HERPepRXo3A

O.o ... ou sera' que foi so' a gaza descobrir que la' em gaza apenas a detestam ainda mais do que as criancas e mulheres portuguesas?... 

sexta-feira, 26 de setembro de 2025

olha ::: "cultura geral"... o.O?...

https://en.wikipedia.org/wiki/Livity_(spiritual_concept)

  https://youtu.be/_IsBq1HBBoY






...

https://youtu.be/rWpeOpa23Sc?t=1960

& soundtrack

https://youtu.be/iPF0kpFLXl4

  https://youtu.be/37DI8w17pOU





"no comments"

https://youtu.be/8EifJWbY_RI

o.O?...

  https://youtu.be/R2mO_XFiXKc 



"no comments"

https://youtu.be/tdPZCslOx7o

"they"... :( ... are all wrong!!!... :D ... soundtrack ...

https://youtu.be/CGMvPeXwGrs

 https://youtu.be/GmG4X9PGOXs

  https://youtu.be/CUiWvSLNPNk

"quando for rico"... o.O?...

O.o ... vou comprar um GPU para as minhas filhas brincarem... o.O?... enquanto lhe chamam de "trabalhar"... o.O?... a usar os neuronios para o mais util de resolver, e se evitarem explodir e auto-genocidar ::: como fazem as pessoas maluconas & doidos afins dos abortos escusados & abanono nefasto (tm), de cheirar-mal demasiado mal e auto-intoxicar sempre demais a vida em geral... :( 

 https://youtu.be/lNumJwHpXIA

https://youtu.be/bR-f19D6gzU

 https://youtu.be/EpdI-NlIIAw

https://youtu.be/15pOr1E6hvc

o.O?...

& "let there be" life... :)




"the monarc"... o.O?...

https://youtu.be/S53xBQ3gkjc

O.o ... has been, long time ago by its royal porno-intoxicated pseudo-"royal court" of lgbtards that now rule in sub-divide divided chaos that "they" call "party"... :( ... "they are cowards ::: "they" are "legion"... :( ... of self-deceiving liars trying to drag everyone else around by force of leveraged plain stupidiy... :( ... it is very noticeable, in deed has become a fashion ::: https://youtu.be/pC8MFUGW7xs?t=77

"few comments"... o.O?... soudtrack ...

https://youtu.be/zz_hlKSwXUw

O.o ... "Sr. Enginheiro" ::: epah, parabens!.. :(

o.O?... os previsto "acidentes" ja' esperados por "estatistica" conhecida resultam sempre numa escusada merdia de mortos e mais vida destruida... :( ... sempre mais as dos ignorantes que te obedecem para se acidentarem e 'as vitimas arrastadas na tua imposicao das tuas pessimas ideias maioritariamente apenas "certificadas" por burreza de pseudo-altesa manienta de apenas se conseguir mentir, enganar e censurar com processos anti-vida de degenerar tudo em geral e cheirar mal... :( ... uau ::: e tem advogado incompetente que apenas se tralha quando fora do seu excessivo ilusorio luxo deprimente e pseudo-esterilizado de afinal apenas se-nos intoxicar mais a todos e 'a vida em geral... o.O?... uau ::: alavanca refinado explosivo & entropecedor (tm) apenas para ewntropecer mais geral & cheirar mais mal... :( ... e por falar na "centralizacao" obviamente falhada & contra-natura mal pintalgada de superficie falsi-ficada sem substancia benefica 'a vida destes "humanos" auto-genocidas que apenas maioritariamente se acorvardam para o lado mais explodido e intocicante ainda sem conseguirem parar... o.O?... culpar deus pelo livre arbitrio porque se chora ::: e' apenas uma beca hipocrita... :P

 https://youtu.be/jARp24AJWLk

O.o ... though no longer "peaking" so much as such can not last forever in this waving world... :)

  https://youtu.be/A439AEWTJd8



& replay soundtrack ... o.O?...

https://youtu.be/hxgS9aR1bkU

 https://youtu.be/7Ui7KhnCC6s

lolz ... "told you" ::: "the pirates are comming"... o.O?...

O.o ... nowadays it is very noticeable...

  https://youtu.be/L2OJFqs8bUk?t=78

"capture the flag"... o.O?...

https://youtu.be/rv_fkX9luvo

O.o ... yap ::: os islamitras conseguiram meter a sua bandeira a voar no territorio dos seus inimigos a quem tanto detestam... o.O?... e os ingleses so' agora e' que deram por isso... :P

  https://youtu.be/R2mO_XFiXKc

quarta-feira, 24 de setembro de 2025

& ... "while you sleep"... o.O?... soundtrack ...

https://youtu.be/YN20pnCjya0

 https://youtu.be/EpdI-NlIIAw

100 cabecas divididas... o.O?... soundtrack ...

O.o ... apenas pensam pior, do que uma ou poucas pessoas unidas... o.O?... e, mesmo muito, pior... :( ... o.O?... nota-se muito bem... :( ... sobre como os grupoides de covardes, em geral apenas pensam e agem mal, de apenas chegar mais ao entropecido de cheirar mais mal... :( ... fazer e tentar impor mal nao lhes cansa... :( ... aos auto-genocidas de tentar arrastar geral para a precipitacao escusada da discordia e e atrun-falho 100% escusado, e na realidade tambem 100% involuntario (acreditam todos que estao fazendo "muito bem", certo?... ate' quando estao quase sempre a fazer mal?... o.O?... lolz ::: "eu" tambem... :P ... e oh despois ::: "logo ve"...




terça-feira, 23 de setembro de 2025

yap :: eu, a minha esposa catarina e as minhas filhas... :)

O.o ... tambem achamos que as tal "mortagua" & "martins" (tm) sao umas "porcas" e cheias dos pessimos maus espiritos dos abortos escusados e do abandono nefasto... :\ ... e no entanto nao andamos pelas ruas a impedir as pessoas de passar... :P ... como fazem os "criminosos" e os bofias corruptos... :( ... e yap ::: tambem nao usamos amplificadores micro/mega-phonicos para as nossas refilices cantaroladas, e para quem queira auto-enfiar barrete & zarpar se lhe apetecer evitar-se pseudo-"ofender"... :) ... com nada de realmente ofensivo que estejamos a realmente a dizer... :D


soundtrack... :) ... and video...

https://youtu.be/bKdzUVyo6uY

 https://youtu.be/7Ui7KhnCC6s

segunda-feira, 22 de setembro de 2025

yap ::: esquerda vs direita ... o.O?...

O.o ... sao aquelas pessoas que estao sempre de acordo ::: sobre como auto-chamam de "trabalhar" a viverem 'a paleta das pessoas impostadas por mera imposicao e ameca a sua saude... :(

  https://youtu.be/bD2E6y0C6PY

hoops ::: portugal da' mais um tiro no pe'... :(

O.o ... e reconhece a o "estado da palestina"... :( ... sem que as exigencias que dizia requerer estarem satifeitas ::: o "hamas" ainda nao se entregou e os refens ainda nao foram libertados... :(

e para quem nao gosta ouvir... o.O?...

O.o ... parciais teorias vomitadas por flotilhad@s de aldrabar... o.O?... ha' "noticias" bem mais esclarecedoras sobre a realidade e as tais "ajudas humanitarias"...

  https://youtu.be/Gfno1fmlLRI

yap ::: no portugal... o.O?...

O.o ... pagamos aos lgbtard@s para se andarem a turistar e parlamentar ::: apenas numa de motivarem sempre mais os outros portugueses (que falam portugues) a se esclarecerem e se aderirem sempre mais ao parto natural e ao ensino domestico no nosso lindo portugal da escravatura abolida e da "censura nunca mais"... :) ... e a se evitarem mal investir em abortos escusados & abanono nefasto... :D

  https://www.youtube.com/shorts/7Lokk5NMeVU

e agora temos ainda mais cursos online... o.O?...

O.o ... sobre como apanhar pessoas mentirosas a mentir... :P

  https://youtu.be/JLrttBnZ9u0

e enquanto os flotilhados se auto-atrun-falham em sua imensa hipocrisia... o.O?...

https://youtu.be/EbGFgc5kvPw

O.o ... uau ::: o tal "GPS" afinal nao funciona ::: porque e' suposto nao funcionar... o.O?... segundo os mais peritos ::: porque inventamos nada disto... :)

... mas nao faz mal ::: porque todos os verdadeiros navegadores se sabem orientar bem pelas estralas... o.O?... e concerteza deve haver muito bons navegadores na tal grande flotilha cheia de uma grande variedade de incompetencia e hipocrisia lgbtarda a bordo...

O.o ... & viva as "estrelas".... :D

  https://youtu.be/7Ui7KhnCC6s

domingo, 21 de setembro de 2025

hoops ::: de visita ao antro do trele-visates teatrais de aldrabar... :D ... soundtrack ...

https://youtu.be/MUE0YmuK6Hk

... lol ::: a rita deu um "tok" no "tik"... :)

O.o ... a ver se se toca.

... e em nome das "virgens ofendidas" por escusad@s abortantes invasores dos ventres das "mulheres" portuguesas... :( ... e entao?... qual e' o problema de considerar os corpos e as boas vontades provida das "virgens" e as "criancas"?... e os "adultos" e toda a gente?...

O.o ... yap ::: there is no "left" vs "right"... o.O...

... is just more like "right" vs "wrong"... :P

  https://youtu.be/U8IoLkoQ19E

O.o ... while you keep hostages... :(

... your dead won't be counted... :(

  https://youtu.be/fFHV7o4SSZ8

agua morta foi bater mal para outra porta... :P

O.o ... sera' que vai conseguir vender abortos escusados e abandono nefasto (tm) aos "hamas" e ajudar a liberar os refens, sobre os quais sempre se evita comentar?... em vez de andar por aqui a vomitar suas pessimas sugestoes "criminosas" para investimentos em porno-intoxicancia, auto-"genocidio" e infanticidio 100% escusado... :P



https://youtu.be/3IT_rnV1LBw?t=434