Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Doom Mathematic posted:

But why doesn't Bash check the syntax of a call to its own builtin before run time? If it's an external executable with a funny name, fine, but the builtin is right there. :psyduck:
because [ existed as a program before it existed as a builtin command, and the purpose of building it in was to improve performance, not to change the POSIX-specified behavior.

I suppose it would be theoretically possible to augment the grammar to check the syntax of [ commands, if someone wants to take up the task. It's just not necessary. Arguably what could be done was done with the [[ command.

Gazpacho fucked around with this message at 20:37 on Oct 11, 2017

Adbot
ADBOT LOVES YOU

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
You should consider as well that the information needed to check "test" syntax while parsing is not necessarily "right there", since the external test command could take arbitrary computed arguments, including computed operators. You can say that's bad practice, but it's still standardized legacy behavior.

Soricidus
Oct 21, 2010
freedom-hating statist shill
reminder that if you are in a position to care about bash handling of syntax errors in [ expressions, you already hosed up. rewrite that script in an actual programming language and watch as the 1970s problems vanish!

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
Wrap it up compileailures, Bash is as legitimate as lisp or js

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Soricidus posted:

reminder that if you are in a position to care about bash handling of syntax errors in [ expressions, you already hosed up. rewrite that script in an actual programming language and watch as the 1970s problems vanish!

which is preferable: bash scripting or nodejs scripting

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

MALE SHOEGAZE posted:

which is preferable: bash scripting or nodejs scripting

jcl

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


Gazpacho posted:

Wrap it up compileailures, Bash is as legitimate as lisp or js

https://www.youtube.com/watch?v=0WhuikFY1Pg

Sapozhnik
Jan 2, 2005

Nap Ghost

MALE SHOEGAZE posted:

which is preferable: bash scripting or nodejs scripting

nodejs, a thousand times

akadajet
Sep 14, 2003


you're right. there is no legitimate use for lisp

FlapYoJacks
Feb 12, 2009

Sapozhnik posted:

nodejs, a thousand times

I would rather not have to install nodejs just for a script when Bash is built into the install.

hobbesmaster
Jan 28, 2008

just give up on all pretense of legibility and write it in perl

akadajet
Sep 14, 2003

ratbert90 posted:

I would rather not have to install nodejs just for a script when Bash is built into the install.

lol if node isn't already installed on ur box

FlapYoJacks
Feb 12, 2009

akadajet posted:

lol if node isn't already installed on ur box

I would rather not install (extra) trash scripting languages onto my computer.

You might as well ask me to run a loving PHP script. Why use node when python is a thing?

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

ratbert90 posted:

Why use node when python is a thing?
Because you're a terrible coder who only knows javascript.

(That's Node's tagline, right?)

FlapYoJacks
Feb 12, 2009

Fiedler posted:

Because you're a terrible coder who only knows javascript.

(That's Node's tagline, right?)

No, because that's implying their coders.

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

MALE SHOEGAZE posted:

which is preferable: bash scripting or nodejs scripting
Is suicide an option?

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

MALE SHOEGAZE posted:

which is preferable: bash scripting or nodejs scripting

lisp scripting obviously

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
have you ever encountered a bug in bash and had to check the bash source code? i don't wish that on my worst enemies

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
http://git.savannah.gnu.org/cgit/bash.git/log/

here's a start

FlapYoJacks
Feb 12, 2009
Looking through that, it's not so bad.

Ever had to debug TI DSP kernel code?
This was years ago, but when we asked for help TI said "oh yeah, the ONE engineer we had supporting that code in India left. You are on your own."

This was a year after the chip was released.

Edit: This was a TI DM368

hobbesmaster
Jan 28, 2008

ratbert90 posted:

Looking through that, it's not so bad.

Ever had to debug TI DSP kernel code?
This was years ago, but when we asked for help TI said "oh yeah, the ONE engineer we had supporting that code in India left. You are on your own."

This was a year after the chip was released.

Edit: This was a TI DM368

arm926 released in 2011, nice

Cybernetic Vermin
Apr 18, 2005

MALE SHOEGAZE posted:

which is preferable: bash scripting or nodejs scripting

the end of post-modern society right here

MrMoo
Sep 14, 2000

ratbert90 posted:

Why use node when python is a thing?

WebSockets requires Python 3.4 for async coroutines, easier to target with Node until places update.

That's my excuse.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

quote:

why use anything else when Lisp is a thing?

FlapYoJacks
Feb 12, 2009

hobbesmaster posted:

arm926 released in 2011, nice

Yeah, and we asked for help mid 2012. TI is trash.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
idk where you are finding all these unreadable bash scripts but probably they are written by the same people who write unreadable code in any lang

hifi
Jul 25, 2012

Suspicious Dish posted:

have you ever encountered a bug in bash and had to check the bash source code? i don't wish that on my worst enemies

i did that with freebsd's sh and added some extra documentation to the man page about one of the config options + $PS1/$PS2

Soricidus
Oct 21, 2010
freedom-hating statist shill

Gazpacho posted:

idk where you are finding all these unreadable bash scripts but probably they are written by the same people who write unreadable code in any lang

if someone’s going to write bad code, I’d rather they did it in a real programming language with a standard debugger and an extensive standard library and some kind of diagnostics when something goes wrong.

not a shell whose idea of debugging is “print every command before it gets executed”, and which relies on spawning other processes and parsing their textual output to achieve anything, and whose idea of error handling is “maybe check exit codes some of the time, maybe some stuff might sometimes get printed to stdout and/or stderr, good luck!”

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

hifi posted:

i did that with freebsd's sh and added some extra documentation to the man page about one of the config options + $PS1/$PS2
he's referring to the fact that the bash maintainer doesn't use git in the Age of Git but posts diff files on the GNU download site much the same way as when it was being distributed over usenet

i admit it's not ideal, but neither is it all that difficult to slurp all the patches into the VCS of your choice, as long as you have some program lying around that can generate and execute a series of Unix commands

Progressive JPEG
Feb 19, 2003

Sapozhnik posted:

i'm glad YouTube Herpes is (mostly) no longer a thing and you can click "don't ever loving show me anything like this poo poo again" on its recommendations now

good to see Google demonstrating even a minimal level of competence for once

the recs are still kinda bizarre though. Like I watched two (2) speedruns of Cuphead and now it thinks I really fuckin like me some Cuphead

why are you visiting youtube with cookies enabled

Notorious b.s.d.
Jan 25, 2003

by Reene
perl and nodejs are both better than bash

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Gazpacho posted:

he's referring to the fact that the bash maintainer doesn't use git in the Age of Git but posts diff files on the GNU download site much the same way as when it was being distributed over usenet

i admit it's not ideal, but neither is it all that difficult to slurp all the patches into the VCS of your choice, as long as you have some program lying around that can generate and execute a series of Unix commands

no, i'm referring to the actual codebase. but a teaser for how bad it actually gets comes in the form of the lovely patchlevel management system the maintainer uses

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
it def. reflects the coding practices of the period in which it was originally written and i understand that radical restructuring would be opposed in view of how system critical it is. otoh the changelog for the last release mentions fixes for issues that should never have passed code review in the first place

bourne said that one of his regrets was that he never wrote a shell compiler & i wonder what it would look like to split script execution between compiling to primitives and executing them, would it be easier to verify? (note that compiling to C is not what i have in mind)

Gazpacho fucked around with this message at 06:27 on Oct 12, 2017

Helianthus Annuus
Feb 21, 2006

can i touch your hand
Grimey Drawer

Soricidus posted:

if someone’s going to write bad code, I’d rather they did it in a real programming language with a standard debugger and an extensive standard library and some kind of diagnostics when something goes wrong.

not a shell whose idea of debugging is “print every command before it gets executed”, and which relies on spawning other processes and parsing their textual output to achieve anything, and whose idea of error handling is “maybe check exit codes some of the time, maybe some stuff might sometimes get printed to stdout and/or stderr, good luck!”

this is 100% right, but consider this counterpoint:

umm... umm.. fuk u i like bash :colbert:

Helianthus Annuus
Feb 21, 2006

can i touch your hand
Grimey Drawer
*shell execs from a java app*

finally programming like a grown up :peanut:

Shaggar
Apr 26, 2006

Notorious b.s.d. posted:

perl and nodejs are both better than bash

a sharp stick in the eye is better than bash

FlapYoJacks
Feb 12, 2009

Notorious b.s.d. posted:

perl and nodejs are both better than bash

lol, gently caress no.

NodeJS is bad because it gives javascript script-kiddies the ability to gently caress up your system, not just your browser.

Shaggar
Apr 26, 2006
node perl and bash all solve fake problems invented by using Linux.

Sapozhnik
Jan 2, 2005

Nap Ghost
even java is a better scripting language than bash

Adbot
ADBOT LOVES YOU

spankmeister
Jun 15, 2008






Sapozhnik posted:

even java is a better scripting language than bash

lol

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply