Closed ghost closed 5 years ago
This specific toy example is intended to give you a feeling of the language. Look at the other examples to find real utility in terms of expressiveness, conciseness, and performance.
@dspinellis that may be true, but its hard to take this project seriously without a real world example, or at least one that would be more difficult with current software.
@cup Am I missing something? There are 18 other examples on the web page.
@dspinellis this is a good example:
#!/usr/bin/env dgsh
tee |
{{
printf 'File type:\t'
file -
printf 'Original size:\t'
wc -c
printf 'xz:\t\t'
xz -c | wc -c
printf 'bzip2:\t\t'
bzip2 -c | wc -c
printf 'gzip:\t\t'
gzip -c | wc -c
}} |
cat
but thats not the first example - the first example is the one i put in the original post. as a new user it can be distracting if the first example someone encounters can be more easily solved with current tools - i would recommend removing the current first example and replacing with the one in this comment
Good point!
visiting this page:
https://spinellis.gr/sw/dgsh
i came across this example:
this example is confusing, as you can rewrite it with a single POSIX AWK script:
surely an entirely new shell doesnt need to be written in this case?