Salta al contenuto principale



Neox does NOT like DIRT!



in reply to Hard Is Easy

Re: Neox does NOT like DIRT!


This is a pretty huge oversight... it sounds like the first edition neox will need constant upkeep like a bike chain, etc!

Quite a departure from the typical "throw it in your bag" grigri.



Question About Bash Command Grouping Behavior in Script vs CLI


Question for you all.

I was working on a bash script and working out some logic for command chaining and grouping for executing different functions in my script based on the return status of other functions.

I know you can group commands with (), which spawns a subshell, and within the grouping you can chain with ;, &&, and ||.

I also know that you can group commands with {}, but, within the curly braces you can only separate commands with ;.

EDIT: the above statement of the curly braces only allowing ; is incorrect. I misunderstood what I had read. @SheeEttin@lemmy.zip pointed out my mistake.

The requirement is that the list of commands in the curly braces needs to be terminated with a semicolon or a newline character, and in the script, I unknowingly was meeting the rules by using the newlines to make the code easier to read for myself.

END EDIT:

In the script, for readability I did group the commands across lines kind of like a function.

The script is pretty simple. I created a few functions with echo commands to test the logic. the script asks for input of foo or bar. The first function has an if, and if the input is foo, it executes. If it's bar it returns 1.

The return of 1 triggers the or (||) and executes the second command group.

The idea was, if the user inputs foo, the first group triggers printing foo baz to stdout. If the user inputs bar, the foo function returns 1, the baz function does not execute, the or is triggered, and bar but is printed to stdout

Here's the script (which executes as described):

Can anyone explain why I'm able to group with curly braces and still use && inside them?

(Also, the reason I want to use the curly braces is I don't want to spawn a subshell. I want variable persistence in the current shell)

\#! /usr/bin/bash

# BEGIN FUNCTIONS #

foo () {

    if [[ "${input}" = foo ]]; then
        echo "foo"
        return 0
    else
        return 1
    fi

}

bar () {

    echo "bar"

}

baz () {

    echo "baz"

}

but () {

    echo "but"

}

# END FUNCTIONS #

read -p "foo or bar? " input

{
    foo && 
    baz
} ||

    {
        bar &&
        but
    }
Questa voce è stata modificata (1 mese fa)
in reply to harsh3466

You're confusing a lot of things here. The operators you're referring to all do different things, not just "chaining" commands together. They are used to do basic logic operations based on the preceding conditions or comparisons.

For example: || does an OR operation, while && does an AND operation.

Using { } is an operative grouping or something in bash. It's used to make arrays, group function commands, and iterate on lists as well. In this case you've created a group of commands that will execute in order, then give an output result. Everything inside the curly braces is treated as one command, essentially.

Practical explanation here

in reply to just_another_person

Thank you for the link!

I do understand the logic and the difference between ;, &&, and `||. What was confusing me was the command grouping and my misunderstanding of the curly brace grouping rule that the command list has to END with a semicolon. @SheeEttin@lemmy.zip pointed out to me with the link in the comment they left.

I had read that same link and misunderstood it. On second read I got it, and see now why my script is working, as the newlines serve the same purpose as the semicolon, so the curly braced groups are terminated correctly.

in reply to harsh3466

gnu.org/software/bash/manual/b…

I don't see any mention of only being allowed to use a semicolon. I don't have a test system handy unfortunately.

Ideally you'd simplify or separate your logic so that you're not relying so much on bash. If you need complex logic, I'd use another language, depending on what's available in your environment.

in reply to SheeEttin

Ah! I misinterpreted what I read! I found that exact same reference link when looking into this and I misinterpreted this:

The semicolon (or newline) following list is required


to mean that it required the semicolon as the command separator. That explains why my script works. The newline closes each group, and the other operators are allowed, the list just needs to be closed. Thank you!

in reply to SheeEttin

My environment is just my homelab. Ubuntu server on my server, Arch (btw) on my laptop. So I could go with any language , but right now I'm choosing Bash. I know stuff I'm doing would probably be easier in a different language, and maybe I'm a glutton for punishment. I just want to get really good with Bash.

The logic is Bash is gonna be available on just about any computing environment I encounter (linux especially, but even Windows with WSL and zsh on macOS (which I know is different, but still very similar). But really, I am just enjoying the hell out of learning and scripting with Bash. I'll move on to Python or something someday.



Russian troops liberate Novotoretskoye community in Donetsk region over past day


Another L for the Nazi regime of Ukraine 💪
in reply to jackeroni

hopefully this needless violence will be over soon.
in reply to jackeroni

If you want to do pro russian war reporting, you have to be smarter about it. Just using the liberation rhetoric did not work since iraq. (At least not on anyone with half a brain). But yes ukrainian community was indeed liberated from ukrainian leadership.
Questa voce è stata modificata (1 mese fa)


EU using Goebbels-style propaganda to fuel anti-Russia frenzy – Lavrov


in reply to jackeroni

Buddy needs to have a listen to what Russian media is saying about "the West", then. Hoo-wee. It's fuckin' dark, man.
in reply to Archangel1313

our oligarchs created modern russia back in 1991; so it makes sense that they would learn how to do it from us.
in reply to eldavi

Putin learned how to do all this from his time in the KGB. It's all just old Soviet Cold War tactics. Turns out, Russians have more agency than you give them credit for.
in reply to jackeroni

Because if they come for the communists first, everyone else is too propagandized to fight the fascists, until it's too late?

in reply to crankyrebel

I'm worried they'll be doctored to shit, maybe they can't release doctored versions of them because someone with knowledge of the originals would call them out (if you're that person stay safe!), but when (and I mean when, they're waiting until they've gotten all the good people out of the way before they try lying) they're going to be full of nothing but their common targets and enemies.

Still though release the damn files, they were on your fucking desk and you gave to podcasters

in reply to Donjuanme

IT WAS ALL HILLARY CLINTON AND OBAMA! EPSTEIN AND GHISLAIN WERE FALL GUYS! BILL GATES FUNDED THE OPERATION!
in reply to IttihadChe

I’LL PROVE IT ONCE I’M CONFIDENT THE FBI HAS SCRUBBED EVERYTHING ABOUT ME AND MY FRIENDS FROM THE FILES!
in reply to kautau

Three weeks later

HERE ARE THE FILES IN THEIR COMPLETE AND UNALTERED FORM:

Link to an empty word doc that just says "If I go to jail I'll kill myself. I sure hate trump."



Eleven-minute race for food: how aid points in Gaza became ‘death traps’ – a visual story


Mahmoud Alareer, a 27-year-old living in a tent in western Gaza City, says the opening time announcements for the aid site he uses – Wadi Gaza – have become useless, because of the distance from where he is living. Instead, he travels to the edges of the site in the middle of the night and gambles on it opening at 2am, as it has on every visit so far.

First he climbs on to the back of a truck for the long ride south from Gaza City through the militarised Netzarim corridor. Then he waits in the dark until Israeli forces allow him to enter. “You get there and you slowly, slowly advance,” he says. “You always know that it could be you who gets shot, or it might be someone next to you.”




in reply to HonoraryMancunian

Lol, how has nobody posted this South Park link yet?

youtu.be/PN51L4iJLow

in reply to HonoraryMancunian

What's this? Another purity test? You're not doing enough and are, therefore, colluding with the oppressors?


Bangladesh air force plane crashes into college campus, killing at least 31


A Bangladesh air force training aircraft has crashed into a college and school campus in the capital, Dhaka, killing at least 31 people, including the pilot, according to the military.

The F-7 BGI aircraft crashed into the campus of Milestone School and College in Dhaka’s Uttara neighbourhood at about 1pm (07:00 GMT) on Monday, when students were taking tests or attending regular classes.

Most of the injured were aged between eight and 14, said Mohammad Maruf Islam, the joint director of Dhaka’s National Burn and Plastic Surgery Institute, where many victims were treated.



The Pentagon Won’t Track Troops Deployed on U.S. Soil. So We Will.


Despite the fact that Trump’s fearmongering was his typical hyperbole, more than 10,000 troops are deploying or have deployed to the southern border, according to U.S. Northern Command, or NORTHCOM, which oversees U.S. military activity from Mexico’s southern border up to the North Pole.

Under the direction of NORTHCOM, military personnel — including soldiers from the Fourth Infantry Division at Fort Carson in Colorado, one of the Army’s most storied combat units — have deployed under the moniker Joint Task Force-Southern Border, or JTF-SB, since March, bolstering approximately 2,500 service members who were already supporting U.S. Customs and Border Protection’s border security mission.

One-third of the U.S. border is now completely militarized due to the creation of four new national defense areas, or NDAs: sprawling extensions of U.S. military bases patrolled by troops who can detain immigrants until they can be handed over to Border Patrol agents.

#USA



House GOP Has 'Shut Down Congress' to Avoid Voting on Epstein Files


The GOP-led House Rules Committee has shut down activity in the House this week to avoid having to take a vote on the Epstein files. It may not resume activity until September.
#USA


Avatar 3: Fuoco e Cenere svela il suo primo poster e anticipa l'uscita del trailer


Avatar: Fuoco e Cenere ha condiviso il suo primo poster ufficiale, anticipando il debutto del suo trailer in arrivo in concomitanza con I Fantastici 4: Gli Inizi al cinema. Il franchise ideato da James Cameron continua ad espandersi e riporterà molto presto il pubblico affezionato su Pandora in compagnia di Na’vi coraggiosi. Dopo il primo Avatar nel 2009 e il sequel Avatar: La via dell’acqua distribuito nel 2022, Cameron riporterà Jake Sully e la sua famiglia di nuovo in azione con Avatar: Fuoco e Cenere. Terzo capitolo del franchise, ha anticipato la data d’uscita del suo primo trailer ufficiale.

Il film, invece, ha già da tempo fissato la sua data d’uscita per il 19 dicembre 2025.



'Deep Deception': Report Details How Deep-Sea Mining Industry Exploits National Security Fears


Greenpeace exposes the deep-sea mining industry's dangerous greed, manipulating geopolitics for profit while endangering our oceans. Will we allow the industry and right-wing politicians to destroy our planet's last unspoiled wilderness? #SaveOurOceans #ProtectOurPlanet 🌊🚫💔


Archived version: archive.is/newest/commondreams…


Disclaimer: The article linked is from a single source with a single perspective. Make sure to cross-check information against multiple sources to get a comprehensive view on the situation.



'Deep Hole of Their Own Creation': Trump Social Security Administration Cuts Come Back to Bite


The Trump administration's staffing cuts at the Social Security Administration are causing chaos, with workers overwhelmed and services suffering.
#USA



Godot getting serious




Israeli Military Threatens Journalist After He Reports on Starvation in Gaza


The Israeli military’s spokesperson accused Anas al-Sharif of having ties to Hamas for a second time without evidence.


Archived version: archive.is/newest/truthout.org…


Disclaimer: The article linked is from a single source with a single perspective. Make sure to cross-check information against multiple sources to get a comprehensive view on the situation.





Fifteen more Palestinians die from starvation amid Israeli-imposed famine


Fifteen Palestinians died from malnutrition under an Israeli-imposed famine in the Gaza Strip in the past 24 hours, the Palestinian health ministry said on Tuesday.

Four of them were children, including three identified as the infant Yousef al-Safadi, Abd al-Jawad al-Ghalban, 16, and Ahmad Hasanat.
inian health ministry.





Our Reporter Got Into Gaza. He Witnessed a Famine of Israel’s Making.


The people of Gaza face starvation under the joint U.S.-Israeli food distribution system run by the Gaza Humanitarian Foundation.


Archived version: archive.is/20250721214914/thei…


Disclaimer: The article linked is from a single source with a single perspective. Make sure to cross-check information against multiple sources to get a comprehensive view on the situation.


in reply to BrikoX

The House overwhelmingly opposed the amendment, and it failed 422 to 6. Representatives Al Green (D-Texas), Marjorie Taylor Greene (R-Georgia), Summer Lee (D-Pennsylvania), Thomas Massie (R-Kentucky), Ilhan Omar (D-Minnesota), and Rashida Tlaib (D-Michigan) voted for the legislation.







Baku handed over to Russia "evidence of murder" of Azerbaijanis in Yekaterinburg




Il Campo e la Trincea: La Memoria del Tenente Luigi Ferraris


il nome di Luigi Ferraris risuona potente nella memoria collettiva di Genova e non solo. A lui è intitolato (dal 1933, in occasione dei quarant’anni dalla fondazione del suo club) uno stadio storico, quello sito nel quartiere di Marassi, ove tuttora scendono in campo le due principali squadre del capoluogo ligure, Genoa e Sampdoria. Inoltre, egli è assurto a simbolo eloquente di un'intera generazione sacrificata sull'altare della Prima Guerra Mondiale


in reply to chobeat

Inverse Ron Swanson. Inhabit corporations and make shit run as inefficiently as possible.
in reply to acosmichippo

Ron's busy at the daily show.



[Announcement] Zizaran’s Class Gauntlet Event Starts on July 31st


We're once again partnering with Zizaran for another 10-day Class Gauntlet event which will start on July 31st PDT. Racers will need to endure some of the most challenging conditions Wraeclast can throw at them in order to survive the Merciless Gauntlet!

The Event will take place in a Hardcore Solo Self-Found Mercenaries Event League with a range of dynamic damage and life mods as well as some other surprises... Good luck Exiles!

Information, Start Time and How to Join


The following modifiers will be active and apply to monsters and bosses:

Area Level 1-45

  • 20% less Damage Taken
  • 20% Increased Damage
  • 10% Increased Attack, Cast and Movement Speed
  • 2 Additional Projectiles
  • 20% Elemental Penetration

Area Level 46-67

  • 30% less Damage Taken
  • 30% Increased Damage
  • 30% Increased Attack, Cast and Movement Speed
  • Monsters Have 100% Increased Area of Effect
  • 30% Physical Damage as Extra Chaos

Area Level 68-72

  • 20% less Damage Taken
  • 20% Increased Damage
  • 20% Increased Attack, Cast and Movement Speed

Area Level 73-77

  • 25% less Damage Taken
  • 25% Increased Damage
  • 25% Increased Attack, Cast and Movement Speed

Area Level 78-83

  • 30% less Damage Taken
  • 30% Increased Damage
  • 15% Increased Attack, Cast and Movement Speed

Area Level 84 (Excluding tier 17 maps)

  • 150% Increased Unique Monster Life (from 100% last time)
  • 40% Increased Damage
  • Shaper Apparitions (instead of Sirus Apparitions)

Area Level 84 (Tier 17 only)

  • No Additional Modifiers
  • T17 bosses drop 5 fragments

Area Level 85+ (Uber Bosses)

  • 60% Less Damage Taken (from 50% last time)
  • 125% Increased Damage (from 100% last time)
  • 40% Increased Attack, Cast and Movement Speed
  • 3 Additional Projectiles
  • Monsters have 50% Increased Area of Effect (from 30% last time)
  • Shaper Apparitions (instead of Sirus Apparitions)
  • Consume Additional Portal on Entry

The Gauntlet will be held as an Event League on PC that is available to all players during the event by clicking "Join" in the bottom right corner of the character select screen.

Players will receive points once per character based on their level, specific boss kills and select Maven's Invitations. Don't forget, to get boss kill points you must submit your kills in the Path of Exile Community Racing Discord which you can join by clicking here.

Start time: 3PM July 31st PDT. The event will last for 10 days. A countdown is available here.

Mercenary Rule


Unintended interactions such as the Bastion's Immunity Buff that was fixed in 3.26.0D Hotfix 4 are prohibited. If you're unsure please check with Viyro on Discord. This rule is entirely up to the Discretion of Zizaran's Admin Team.

Doryani's Prototype will also be disabled from the Gauntlet. It cannot drop or be chanced.

Portal Limitation Rule


In order to receive Boss Kill Points you must use three or fewer portals to kill them! Entering a fourth portal will make your submission null and void. Uber bosses will have this tech by default, the rest will need to be manually verified.

Public Profile Rule:


Players wishing to compete for the main prize pool, bounties or flash bounties must have their profiles continuously set to Public at the start of the event all the way to the end of the event.

A full set of rules can be found here.

Prize Pool


The prize pool is crowdfunded by Zizaran's event partners and community streamers! In addition, streamers and their communities will be able to create a bounty with the money they fundraise for the event. Bounties are a custom prize that can be awarded to players for achieving a specified goal in the vent. This Gauntlet will also have Flash bounties which are bounties that will pop up in the Racing Discord during the event! Keep an eye out on social media for announcements regarding when these fundraisers will take place and what they will be!

Zizaran's event partners will match donations to the prize pool (up to $25,000).

  • The total prize pool minus bounties will be awarded as follows:
    • Rank 1 Overall: 12% Bonus
    • Rank 2 Overall: 4% Bonus
      Witches
    • Top Witch: 8%
    • Second Witch: 4%
    • Third Witch: Heritage Character Effect & Divergence Predator Pet
      Shadows
    • Top Shadow: 8%
    • Second Shadow: 4%
    • Third Shadow: Heritage Character Effect & Divergence Predator Pet
      Rangers
    • Top Ranger: 8%
    • Second Ranger: 4%
    • Third Ranger: Heritage Character Effect & Divergence Predator Pet
      Duelists
    • Top Duelist: 8%
    • Second Duelist: 4%
    • Third Duelist: Heritage Character Effect & Divergence Predator Pet
      Marauders
    • Top Marauder: 8%
    • Second Marauder: 4%
    • Third Marauder: Heritage Character Effect & Divergence Predator Pet
      Templars
    • Top Templar: 8%
    • Second Templar: 4%
    • Third Templar: Heritage Character Effect & Divergence Predator Pet
      Scions
    • Top Scion: 8%
    • Second Scion: 4%
    • Third Scion: Heritage Character Effect & Divergence Predator Pet


Everyone who defeats Hillock will receive a Gauntlet Glove Effect that will keep track of the highest level you reach in Gauntlet Events. If you manage to complete the campaign you'll also receive a Dawn of the Hunt Mystery Box!

Random Draw


Leveling your characters to certain levels will enter you into the random drawings for Microtransactions as well as physical prizes supplied by Zizaran's event partners and Grinding Gear Games! Each character that reaches the goal will give you another entry, so don't delete your characters if you want to be entered for these raffles!


Where to Watch


You can catch exciting moments from the event by checking out Zizaran's Youtube Channel for highlights!

Zizaran and Steelmage will also be joining forces to cast the Merciless Gauntlet this time. You can find out the schedule for this here.

Special thanks to community members Faderon, MrMadakey, Ultimativ, Skryah, OMGItsJousis and Viyro for their contributions to this event.

Good luck to all those participating!

Questa voce è stata modificata (1 mese fa)


in reply to jackeroni

There's nothing "leftist" about a strongman controlling the means of production, and they're definitely not advocating for a stateless society free of coercion. They also have a very strict heirarchy of power, so what exactly makes you think that the regime is leftist in any way? Those bedrock positions are the exact opposite from what one could expect from the left.