Live data from Hacker News

Udp/tcp connection using pure bash

tmartiro.blogspot.com

11–13 of 13 posts

Re: Udp/tcp connection using pure bash

#11
post #10
post #9

Earlier quoted context omitted.

Agreed. These toy-features are especially bitter when you look at how little bash the language has evolved in the past decade. Pretty much every system out there drags a significant baggage of shell-scripts along. Yet there's been barely any improvement on the arcanest of all syntaxes. We keep on painstakingly reinventing ever the same control structures (half-broken lockfile mechanisms, retry loops, miserable suppor…

Lets imagine for a moment that cross-platform backwards compatibility is a high priority, and that every change leads to a frustrated group of users running scripts from many years ago. How could you make a destructive change? As an example, this works in bash 3.2 but not 4.0: diff in 3 it expands to diff whereas in 4 it expands to diff

How could you make a destructive change?

Well, the same way that everyone else does it: by versioning.

The simplest approach would be to have /bin/bash2, /bin/bash3 etc., with /bin/bash defaulting to the last (current) unversioned bash release.

Then when you write a script that depends on a new feature you'd reference #!/bin/bash3 or whatever. More complex schemes are possible but probably not needed here. It's not rocket science.

And as your example illustrates: This kind of versioning is actually needed even in the current (almost stale) development-mode of bash. Its absence is the reason why many people still target sh as the lowest common denominator...

Re: Udp/tcp connection using pure bash

#12
post #11
post #10

Earlier quoted context omitted.

Lets imagine for a moment that cross-platform backwards compatibility is a high priority, and that every change leads to a frustrated group of users running scripts from many years ago. How could you make a destructive change? As an example, this works in bash 3.2 but not 4.0: diff in 3 it expands to diff whereas in 4 it expands to diff

How could you make a destructive change? Well, the same way that everyone else does it: by versioning. The simplest approach would be to have /bin/bash2, /bin/bash3 etc., with /bin/bash defaulting to the last (current) unversioned bash release. Then when you write a script that depends on a new feature you'd reference #!/bin/bash3 or whatever. More complex schemes are possible but probably not needed here. It's not r…

After some thought, what i'd like to see is what's done now with globstar (make new features accessible via shopt)
Post reply on HN