|
Bash is a good terminal but a miserable scripting language. PowerShell is a good scripting language but a miserable terminal. Trying to do both is the folly.
|
# ? Apr 3, 2023 07:45 |
|
|
# ? Jun 8, 2024 06:34 |
|
Since we have powershell defender in here, enlighten us on the usefulness of the curl alias.
|
# ? Apr 3, 2023 07:46 |
|
Xarn posted:Since we have powershell defender in here, enlighten us on the usefulness of the curl alias. redleader posted:powershell is endless terrible decisions around one core and good idea - pass structured data instead of text around
|
# ? Apr 3, 2023 07:58 |
|
Xarn posted:Since we have powershell defender in here, enlighten us on the usefulness of the curl alias. Ain't nobody defending that and MS finally killed that as a default alias in powershell v6 after years of complaints about it from even the most avid powershell fans. Edit: Don't mistake people saying "drat I really like this one aspect of powershell over bash and a lot of the complaints about powershell are overblown or outdated" as being enthusiastic endorsement. All shell scripting is pretty lovely and most people put up with it for certain types of tasks because the alternatives are annoying. Cold on a Cob fucked around with this message at 11:38 on Apr 3, 2023 |
# ? Apr 3, 2023 11:35 |
|
poor shaggar, there's a multi-page powershell flamewar and nobody's seen fit to tap them into the fight
|
# ? Apr 3, 2023 12:48 |
|
Dijkstracula posted:poor shaggar, there's a multi-page powershell flamewar and nobody's seen fit to tap them into the fight There's a reason no one has mentioned this to Shaggar
|
# ? Apr 3, 2023 14:45 |
|
What is PowerShell's stance on bicycle infrastructure?
|
# ? Apr 3, 2023 16:47 |
|
CPColin posted:What is PowerShell's stance on bicycle infrastructure? Did you know that a bikeshed is just as important to the functionality of PowerShell as code itself? Yeah, turns out if you don't have a place to park your bike while you're coding, your brain gets all scrambled and you end up typing gibberish. Trust me, I tried it once and ended up accidentally creating a sentient AI that only communicates in cat memes. So, moral of the story: always make sure you have a bikeshed handy when working with PowerShell.
|
# ? Apr 3, 2023 17:03 |
|
CPColin posted:What is PowerShell's stance on bicycle infrastructure? Presumably its structured approach leans towards protected bike lanes, while Unix shells' everything-is-the-same approach prefers no separation between cars and bicyclists at all? (Also, seriously, how everything-is-a-string means that simple comparisons require either quoting or a hack to not blow up on empty strings in sh does belong in this thread...)
|
# ? Apr 3, 2023 17:18 |
|
In *nix land, if your scripting needs to go beyond basic string comparisons, you move to Python or Pearl.
|
# ? Apr 3, 2023 17:21 |
|
FlapYoJacks posted:In *nix land, if your scripting needs to go beyond basic string comparisons, you move to Python or Pearl. If I can’t walk somewhere, I use a rocket ship.
|
# ? Apr 3, 2023 17:24 |
|
Jigsaw posted:If I can’t walk somewhere, I use a rocket ship. Yes.
|
# ? Apr 3, 2023 17:26 |
|
Jigsaw posted:If I can’t walk somewhere, I use a rocket ship.
|
# ? Apr 3, 2023 17:27 |
|
Volte posted:What is the middle ground between walking and a rocket ship in this metaphor? PHP
|
# ? Apr 3, 2023 17:29 |
|
I just incrementally grow my 2 line bash script into a 2kloc monstrosity all the while bemoaning that this should have been a python script. While I see others building rockets, I'm reporting better progress to management with my tree-climbing technique.
|
# ? Apr 3, 2023 17:59 |
|
code:
|
# ? Apr 3, 2023 18:01 |
|
Beef posted:I just incrementally grow my 2 line bash script into a 2kloc monstrosity all the while bemoaning that this should have been a python script. This was my current team at work a few years ago and we're finally starting to move poo poo over to Python and it's a huge improvement.
|
# ? Apr 3, 2023 18:59 |
|
FlapYoJacks posted:In *nix land, if your scripting needs to go beyond basic string comparisons, you move to Python or Pearl. "Has an array", "has command line arguments", "a string might be empty", and "want to test a commands exit code" are all past that and places where everything-is-a-string starts sucking
|
# ? Apr 3, 2023 19:37 |
|
|
# ? Apr 3, 2023 21:11 |
|
Jigsaw posted:If I can’t walk somewhere, I use a rocket ship. Yeah I would fly around town punching nazis like the Rocketeer if given the chance, absolutely. But using Python is not nearly that cool
|
# ? Apr 3, 2023 23:41 |
|
Perl is less of a rocket ship than a rocket you can strap to your back like the coyote with the same chance of long term success.
|
# ? Apr 4, 2023 00:29 |
|
i think we can all agree that shell scripting isnt real programming anyways, leave that to the janitors
|
# ? Apr 4, 2023 02:04 |
|
QuarkJets posted:Different find tool; you can open up WSL and use `find /mnt/c/ -name libcef.dll`. This will only search file names
|
# ? Apr 4, 2023 05:41 |
|
lifg posted:Perl is less of a rocket ship than a rocket you can strap to your back like the coyote with the same chance of long term success. Perl is like strapping a bunch of fireworks to a chair and "launching" yourself into space, like the Chinese legend of Wan Hu bobthenameless posted:i think we can all agree that shell scripting isnt real programming anyways, leave that to the janitors I told a room mate this in college and he got so mad, if you're out there reading this then I'm sorry but it's still true: shell scripting is for chumps and isn't real programming.
|
# ? Apr 4, 2023 07:10 |
|
it's probably easier to do a typical shell script task (poke around the filesystem, do some stuff with a dynamic set of files you find probably based on arguments that mostly consists of piping output between system programs and transforming the strings or ps objects those system programs return) in bash/ps rather than c/c++/c# but uh that's about the most positive i can say
|
# ? Apr 4, 2023 13:00 |
|
Phobeste posted:it's probably easier to do a typical shell script task (poke around the filesystem, do some stuff with a dynamic set of files you find probably based on arguments that mostly consists of piping output between system programs and transforming the strings or ps objects those system programs return) in bash/ps rather than c/c++/c# but uh that's about the most positive i can say In addition I use scripting for scheduled http calls or sql scripts. A lot of services we use have REST apis so I can whip up a script in a few minutes without having to worry about third party dependencies/libraries/etc.
|
# ? Apr 4, 2023 13:44 |
|
Phobeste posted:it's probably easier to do a typical shell script task (poke around the filesystem, do some stuff with a dynamic set of files you find probably based on arguments that mostly consists of piping output between system programs and transforming the strings or ps objects those system programs return) in bash/ps rather than c/c++/c# but uh that's about the most positive i can say In the past I have literally written C programs to do some of that poo poo because it was faster than figuring out how to do it in bash.
|
# ? Apr 4, 2023 16:56 |
|
Ranzear posted:Bash is a good terminal but a miserable scripting language. I think I would have been happier with "C# but you can pipe output into other commands easily" rather than actually have to read documentation about how to invoke functions in powershell because microsoft's manic pixy dream language is special and unique and doesn't invoke functions the way all the other languages do (with parenthesis like god intended).
|
# ? Apr 4, 2023 17:37 |
|
code:
|
# ? Apr 4, 2023 18:27 |
|
Bruegels Fuckbooks posted:because microsoft's manic pixy dream language is special and unique and doesn't invoke functions the way all the other languages do (with parenthesis like god intended).
|
# ? Apr 4, 2023 21:14 |
|
If you're writing a shell function then you should stop and do something else, I mean that in the biggest way, maybe become a forest ranger or something
|
# ? Apr 5, 2023 01:31 |
|
Bruegels Fuckbooks posted:microsoft's manic pixy dream language
|
# ? Apr 5, 2023 04:28 |
|
QuarkJets posted:If you're writing a shell function then you should stop and do something else, I mean that in the biggest way, maybe become a forest ranger or something I almost wrote a monstrosity of a weird bash script (I don't know bash at all) that involved a bunch of jq parsing and nested bullshit. I'm so glad I finally went 'wait a loving minute I'm doing this in Python'
|
# ? Apr 5, 2023 08:55 |
|
CPColin posted:
ftfy (I have genuinely used this)
|
# ? Apr 5, 2023 09:41 |
|
Falcon2001 posted:I almost wrote a monstrosity of a weird bash script (I don't know bash at all) that involved a bunch of jq parsing and nested bullshit. I'm so glad I finally went 'wait a loving minute I'm doing this in Python' I did this all the time at work. Just scripted TLS cert provisioning with a whole bunch of curl and jq and that sort of thing. Anyway unrelatedly I'm currently looking for a new job after some recent restructuring,
|
# ? Apr 5, 2023 09:56 |
|
The common advice to move to another language when a script gets complicated is not bad advice. But the steadfast refusal to learn the second thing about one's tools continues to be impressive. sh is a mildly esoteric programming language, it's not some impenetrable wall. If you get the vapours at the sight of an at sign, maybe that's on you.
|
# ? Apr 5, 2023 15:27 |
|
pokeyman posted:The common advice to move to another language when a script gets complicated is not bad advice. But the steadfast refusal to learn the second thing about one's tools continues to be impressive. sh is a mildly esoteric programming language, it's not some impenetrable wall. If you get the vapours at the sight of an at sign, maybe that's on you. There are things that are relatively straightforward to do in bash that are somewhat complicated to do in other languages too. Like having two programs running, each piping their stdout to the others stdin
|
# ? Apr 5, 2023 16:03 |
|
Ouroboro.sh
|
# ? Apr 5, 2023 16:22 |
|
Coding Horrors: Ouroboro.sh
|
# ? Apr 5, 2023 17:21 |
|
|
# ? Jun 8, 2024 06:34 |
|
And don't miss out on this...gem from the C/C++ thread:Subjunctive posted:A C++ behaviour that has stumped someone who wrote a time-travelling debugger:
|
# ? Apr 5, 2023 17:23 |