Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.os.linux > #59870 > unrolled thread
| Started by | Soviet_Mario <SovietMario@CCCP.MIR> |
|---|---|
| First post | 2019-10-19 10:58 +0200 |
| Last post | 2019-10-20 22:03 -0400 |
| Articles | 20 on this page of 24 — 10 participants |
Back to article view | Back to alt.os.linux
Bash topics (Memory Usage) Soviet_Mario <SovietMario@CCCP.MIR> - 2019-10-19 10:58 +0200
Re: Bash topics (Memory Usage) Dan Purgert <dan@djph.net> - 2019-10-19 13:15 +0000
Re: Bash topics (Memory Usage) Aragorn <thorongil@telenet.be> - 2019-10-19 15:44 +0200
Re: Bash topics (Memory Usage) Soviet_Mario <SovietMario@CCCP.MIR> - 2019-10-20 01:15 +0200
Re: Bash topics (Memory Usage) Dan Purgert <dan@djph.net> - 2019-10-19 23:25 +0000
Re: Bash topics (Memory Usage) Aragorn <thorongil@telenet.be> - 2019-10-20 12:33 +0200
Re: Bash topics (Memory Usage) "Carlos E.R." <robin_listas@es.invalid> - 2019-10-20 13:39 +0200
Re: Bash topics (Memory Usage) Aragorn <thorongil@telenet.be> - 2019-10-20 16:19 +0200
Re: Bash topics (Memory Usage) "Carlos E.R." <robin_listas@es.invalid> - 2019-10-20 21:08 +0200
Re: Bash topics (Memory Usage) Aragorn <thorongil@telenet.be> - 2019-10-20 21:51 +0200
Re: Bash topics (Memory Usage) "Carlos E.R." <robin_listas@es.invalid> - 2019-10-20 22:12 +0200
Re: Bash topics (Memory Usage) John Hasler <jhasler@newsguy.com> - 2019-10-19 12:33 -0500
Re: Bash topics (Memory Usage) William Unruh <unruh@invalid.ca> - 2019-10-19 21:26 +0000
Linux users who buttfuck the president... Idaho Homo Joe <dick_lick@aol.com> - 2019-10-19 21:47 -0400
Re: Bash topics (Memory Usage) Soviet_Mario <SovietMario@CCCP.MIR> - 2019-10-20 15:19 +0200
Re: Bash topics (Memory Usage) Dan Purgert <dan@djph.net> - 2019-10-20 13:54 +0000
Re: Bash topics (Memory Usage) Richard Kettlewell <invalid@invalid.invalid> - 2019-10-20 15:29 +0100
Re: Bash topics (Memory Usage) William Unruh <unruh@invalid.ca> - 2019-10-20 19:24 +0000
Re: Bash topics (Memory Usage) Richard Kettlewell <invalid@invalid.invalid> - 2019-10-21 10:28 +0100
Re: Bash topics (Memory Usage) Chris <ithinkiam@gmail.com> - 2019-10-20 15:36 +0100
Re: Bash topics (Memory Usage) Paul <nospam@needed.invalid> - 2019-10-20 11:05 -0400
Re: Bash topics (Memory Usage) Soviet_Mario <SovietMario@CCCP.MIR> - 2019-10-20 23:14 +0200
Re: Bash topics (Memory Usage) John Hasler <jhasler@newsguy.com> - 2019-10-20 18:01 -0500
Re: Bash topics (Memory Usage) Paul <nospam@needed.invalid> - 2019-10-20 22:03 -0400
Page 1 of 2 [1] 2 Next page →
| From | Soviet_Mario <SovietMario@CCCP.MIR> |
|---|---|
| Date | 2019-10-19 10:58 +0200 |
| Subject | Bash topics (Memory Usage) |
| Message-ID | <qoej8c$9r5$1@dont-email.me> |
Is it there sort of a "limit" about how much memory can be used in BASH scripts (variable, functions and so). How heavy on memory is the heaviest script ever met ? sub topic. I'm still confused as to how just classify BASH (please for once don't correct the capitalization, is just a way to add emphasis in plain text without colors / bold, italics and so) I mean, is it considered a true programming language ? A scripting language ? what ? I can recall initially also JavaScript/ECMAscript was considered just a scripting (I dunno the exact difference actually) but nowadays it has reached the programming language status much like Java. what topics in general are not suitable for BASH ? I mean, I think it is very fit for file system manipulation, absolutely unfit for graphics. And for TEXTUAL elaboration ? The origin of my confusion is that it resembles more the MACRO / Preprocessor usage than the plain synthax. Is then a MACRO language to a certain degree ? The questions are confused, I know :\ ... -- 1) Resistere, resistere, resistere. 2) Se tutti pagano le tasse, le tasse le pagano tutti Soviet_Mario - (aka Gatto_Vizzato)
[toc] | [next] | [standalone]
| From | Dan Purgert <dan@djph.net> |
|---|---|
| Date | 2019-10-19 13:15 +0000 |
| Message-ID | <slrnqqm341.1ug.dan@djph.net> |
| In reply to | #59870 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Soviet_Mario wrote: > > Is it there sort of a "limit" about how much memory can be > used in BASH scripts (variable, functions and so). As much RAM as you've got, barring some sort of monitor that limits per-user (or per-process, etc). > > How heavy on memory is the heaviest script ever met ? The script? Not very. But I have used scripts on multi-GB files that need to get sorted (or have other "across the entire file" type actions apply). > > sub topic. > > I'm still confused as to how just classify BASH (please for > once don't correct the capitalization, is just a way to add > emphasis in plain text without colors / bold, italics and so) Normally, we'd use quotes for that case (or, depending on the newsreader, _underscore_, *asterisk*, or /slash/ can add the emphasis too.) > I mean, is it considered a true programming language ? A > scripting language ? what ? It's a shell for interacting with the PC, with a built-in scripting language. > I can recall initially also JavaScript/ECMAscript was > considered just a scripting (I dunno the exact difference > actually) but nowadays it has reached the programming > language status much like Java. They're still "scripting" languages. > > what topics in general are not suitable for BASH ? > I mean, I think it is very fit for file system manipulation, > absolutely unfit for graphics. And for TEXTUAL elaboration ? System interaction and textual manipulation (e.g. logfiles). If it's "structured" text (XML, HTML, JSON, etc.), then there are better tools than bash. That being said, bash can be the "glue" for working with structured text, or media files (etc), by handling looping over files in a directory and calling the proper tool to process the file (e.g. jq, or imagemagic, ffmpeg, and so on). > > The origin of my confusion is that it resembles more the > MACRO / Preprocessor usage than the plain synthax. > > Is then a MACRO language to a certain degree ? If I'm understanding what you're trying to ask; "maybe". But I'm not really sure what you mean by "macro language". -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl2rDH8ACgkQjhHd8xJ5 ooEYGwf/XMdoo+EGwfDElxdMcp/FRuvUu8ldfhiMvq3HOiBThm8W3hpOpbu+aIiD X54X0CWjLEWIeQ7GC8nElGOoVUvzngExeiSPPJz+yNDgyjJWERlycmhfYKGPm72i uKW5BxZKA1v4eLEnEUnKSPIDmgkVBCVrBvcarhLb21hsf67p0eOjv2eQsrXJyT5M C3tdG4Sd/A2Xn2Zuj9eQKSi3S+iXS2BQM5BHZJmynhy/ZP04075A378i8+pbF/W5 mVL0F6rxGDcK7V3DTnIxy23RIHQM+isE+Wa4GhXo1YfmQ2maIwbO/tSQ82bpYzNi Oa2r3sjXUTTQiCOpkDJDG86Tnw37oA== =F20E -----END PGP SIGNATURE----- -- |_|O|_| |_|_|O| Github: https://github.com/dpurgert |O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
[toc] | [prev] | [next] | [standalone]
| From | Aragorn <thorongil@telenet.be> |
|---|---|
| Date | 2019-10-19 15:44 +0200 |
| Message-ID | <20191019154440.4aa6d7f3@nx-74205> |
| In reply to | #59882 |
On 19.10.2019 at 13:15, Dan Purgert scribbled:
> Soviet_Mario wrote:
> >
> > I'm still confused as to how just classify BASH (please for
> > once don't correct the capitalization, is just a way to add
> > emphasis in plain text without colors / bold, italics and so)
> >
> > I mean, is it considered a true programming language ? A
> > scripting language ? what ?
>
> It's a shell for interacting with the PC, with a built-in scripting
> language.
>
> > I can recall initially also JavaScript/ECMAscript was
> > considered just a scripting (I dunno the exact difference
> > actually) but nowadays it has reached the programming
> > language status much like Java.
>
> They're still "scripting" languages.
UNIX shell language is, more correctly put, an interpreted language.
Java — as distinct from JavaScript — is a compiled language, albeit
that the binary code is not machine code. It is OS-agnostic and
hardware-agnostic bytecode, which gets executed by the Java
Runtime Engine, which is a virtual machine that runs the compiled Java
code through a just-in-time compiler.
> > The origin of my confusion is that it resembles more the
> > MACRO / Preprocessor usage than the plain synthax.
> >
> > Is then a MACRO language to a certain degree ?
>
> If I'm understanding what you're trying to ask; "maybe". But I'm not
> really sure what you mean by "macro language".
Maybe he means to say that UNIX shell languages [*] is a higher-level
programming language, because it doesn't encompass any low-level
syscalls or assembly code.
[*] Mario: There's more than just GNU Bash, and even Bash has a strict
POSIX mode. FreeBSD does not use GNU Bash by default, and
neither does Solaris (which uses a Korn Shell instead).
macOS has up until now used Bash, but I believe the latest
iteration uses zsh now. And then there's the C Shell. All of
these shells are different.
Bash and other UNIX shells are to UNIX what COMMAND.COM was
to MS-DOS, and what CMD.EXE is to the NT-based Windows
versions (and to OS/2 before it). It is simply a command-
line user interface.
--
With respect,
= Aragorn =
[toc] | [prev] | [next] | [standalone]
| From | Soviet_Mario <SovietMario@CCCP.MIR> |
|---|---|
| Date | 2019-10-20 01:15 +0200 |
| Message-ID | <qog5es$rvj$1@dont-email.me> |
| In reply to | #59883 |
On 19/10/2019 15:44, Aragorn wrote: > On 19.10.2019 at 13:15, Dan Purgert scribbled: > >> Soviet_Mario wrote: >>> >>> I'm still confused as to how just classify BASH (please for >>> once don't correct the capitalization, is just a way to add >>> emphasis in plain text without colors / bold, italics and so) >>> >>> I mean, is it considered a true programming language ? A >>> scripting language ? what ? >> >> It's a shell for interacting with the PC, with a built-in scripting >> language. >> >>> I can recall initially also JavaScript/ECMAscript was >>> considered just a scripting (I dunno the exact difference >>> actually) but nowadays it has reached the programming >>> language status much like Java. >> >> They're still "scripting" languages. > > UNIX shell language is, more correctly put, an interpreted language. > > Java — as distinct from JavaScript — is a compiled language, albeit > that the binary code is not machine code. It is OS-agnostic and > hardware-agnostic bytecode, which gets executed by the Java > Runtime Engine, which is a virtual machine that runs the compiled Java > code through a just-in-time compiler. > >>> The origin of my confusion is that it resembles more the >>> MACRO / Preprocessor usage than the plain synthax. >>> >>> Is then a MACRO language to a certain degree ? >> >> If I'm understanding what you're trying to ask; "maybe". But I'm not >> really sure what you mean by "macro language". with MACRO language I was trying to mean the semantic fluidity created by (multiple) substitution of text, which becomes executable. Also it seems to my first vague impressions that, contrary to many strict languages, BASH could support code "injection" generating text that later is interpreted as a native command. BTW this feature causes me umpteen problems in figuring out what takes place :) > > Maybe he means to say that UNIX shell languages [*] is a higher-level > programming language, because it doesn't encompass any low-level > syscalls or assembly code. > > > [*] Mario: There's more than just GNU Bash, and even Bash has a strict > POSIX mode. FreeBSD does not use GNU Bash by default, and > neither does Solaris (which uses a Korn Shell instead). > macOS has up until now used Bash, but I believe the latest > iteration uses zsh now. And then there's the C Shell. All of > these shells are different. > > Bash and other UNIX shells are to UNIX what COMMAND.COM was > to MS-DOS, and what CMD.EXE is to the NT-based Windows > versions (and to OS/2 before it). It is simply a command- > line user interface. but much more powerful. Now I don't know of modern "power shell" (a definition that seems rather bloating), but 10 y ago the native batch files to be parsed by command.com were not as powerful and flexible as bash script. VBS had been an attempt to create a better tool, but then I did not deepen into the argument. > > -- 1) Resistere, resistere, resistere. 2) Se tutti pagano le tasse, le tasse le pagano tutti Soviet_Mario - (aka Gatto_Vizzato)
[toc] | [prev] | [next] | [standalone]
| From | Dan Purgert <dan@djph.net> |
|---|---|
| Date | 2019-10-19 23:25 +0000 |
| Message-ID | <slrnqqn6ro.1ug.dan@djph.net> |
| In reply to | #59912 |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Soviet_Mario wrote: > On 19/10/2019 15:44, Aragorn wrote: >> On 19.10.2019 at 13:15, Dan Purgert scribbled: >> >>> Soviet_Mario wrote: >>>> The origin of my confusion is that it resembles more the >>>> MACRO / Preprocessor usage than the plain synthax. >>>> >>>> Is then a MACRO language to a certain degree ? >>> >>> If I'm understanding what you're trying to ask; "maybe". But I'm not >>> really sure what you mean by "macro language". > > with MACRO language I was trying to mean the semantic > fluidity created by (multiple) substitution of text, which > becomes executable. Also it seems to my first vague > impressions that, contrary to many strict languages, BASH > could support code "injection" generating text that later is > interpreted as a native command. You're still not really making sense; but if you mean "can I store a command in a variable and execute it later?", yes, you can. For example: $> command="ls -l" $> $command drwxr-xr-x 6 tdd tdd 4096 Sep 25 13:18 . drwxr-xr-x 4 tdd tdd 4096 Oct 3 10:00 .. drwxr-xr-x 6 tdd tdd 4096 Sep 23 11:44 build [...] $> -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl2rm3gACgkQjhHd8xJ5 ooEscQf+MUYS9a01ZcBcLog5xEYUKeEqUQ4Vh8OC138s16y2Exp9OWVeEWSJQy4f DlQ60S3+VpYXENKnYSAv/g3XQCevEsfo1bXbzLqkOPJclw2WfgZwmKG0NdjJTrJ+ Uwrjs6nKK2gvwcREVTHUczLzbel3eJb7s8ptfoAJC7vFhoushg5nLUiq+RgtwtB7 Pra3Pq9J7Fz2djRzcPGLvU97bAPqjzRkb5qn8GL3MuTZpAVAO0OkgOsbtK2mUkGk 94gCZUrurBeIflkcft7/Cph45tXEyIFO2rjJOOdb3a2yZCGhWGzBUKrAb7vDvBW1 pLbhLMzgZgtANcs9+vnvc33PqiCnTg== =mqiw -----END PGP SIGNATURE----- -- |_|O|_| |_|_|O| Github: https://github.com/dpurgert |O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
[toc] | [prev] | [next] | [standalone]
| From | Aragorn <thorongil@telenet.be> |
|---|---|
| Date | 2019-10-20 12:33 +0200 |
| Message-ID | <20191020123354.2b916e90@nx-74205> |
| In reply to | #59912 |
On 20.10.2019 at 01:15, Soviet_Mario scribbled: > with MACRO language I was trying to mean the semantic > fluidity created by (multiple) substitution of text, which > becomes executable. By that definition, even assembler is a macro language. Hell, even the x86 instruction set would qualify as a macro language, because the x86 architecture is a CISC processor, and its instructions are macros of opcode. > Also it seems to my first vague impressions that, contrary to many > strict languages, BASH could support code "injection" generating text > that later is interpreted as a native command. Every programming language — barring perhaps assembler, because I don't remember whether it allowed for that — can do that. > > [*] Mario: There's more than just GNU Bash, and even Bash has a > > strict POSIX mode. FreeBSD does not use GNU Bash by > > default, and neither does Solaris (which uses a Korn > > Shell instead). macOS has up until now used Bash, but I > > believe the latest iteration uses zsh now. And then > > there's the C Shell. All of these shells are different. > > > > Bash and other UNIX shells are to UNIX what COMMAND.COM > > was to MS-DOS, and what CMD.EXE is to the NT-based > > Windows versions (and to OS/2 before it). It is simply a > > command- line user interface. > > but much more powerful. Why, yes, of course, but this ties in with the greater functionality and power of the underlying operating system as well. UNIX is a multiuser architecture, whereas DOS wasn't even multitasking. > Now I don't know of modern "power shell" (a definition that seems > rather bloating), [... PowerShell is an object-oriented shell, whereas POSIX shells are byte-stream oriented. > ...] but 10 y ago the native batch files to be parsed by command.com > were not as powerful and flexible as bash script. Of course. See higher up. DOS was a single-tasking environment and a much simpler operating system in every respect. > VBS had been an attempt to create a better tool, but then I > did not deepen into the argument. OS/2 had ReXX, an interpreted language that was also used in OS/400. It was a lot more powerful than the "DOS legacy" language. Its syntax was rather elegant too — it reminded me of Pascal and C, albeit that I don't really know C. -- With respect, = Aragorn =
[toc] | [prev] | [next] | [standalone]
| From | "Carlos E.R." <robin_listas@es.invalid> |
|---|---|
| Date | 2019-10-20 13:39 +0200 |
| Message-ID | <pjtt7g-up7.ln1@Telcontar.valinor> |
| In reply to | #59921 |
On 20/10/2019 12.33, Aragorn wrote: > On 20.10.2019 at 01:15, Soviet_Mario scribbled: ... > >> ...] but 10 y ago the native batch files to be parsed by command.com >> were not as powerful and flexible as bash script. > > Of course. See higher up. DOS was a single-tasking environment and a > much simpler operating system in every respect. Not only that. Back in the time, before we could compare with bash, batch scripting was very limited and needed external helpers. For example, for handling a menu of options, we had to use an external program to query the keyboard, which would return a number, an exitcode, not a letter; later a trick to obtain letters was invented. Similarly the "language" would not allow entering text. Other things that I remember... there were no function calls. I don't remember if "case" was supported. Or limited string manipulation. Basic math? As a scripting language it was very limited - even without considering multitasking. Some people made wonders with them, but they required to include some executable helper with the script. -- Cheers, Carlos.
[toc] | [prev] | [next] | [standalone]
| From | Aragorn <thorongil@telenet.be> |
|---|---|
| Date | 2019-10-20 16:19 +0200 |
| Message-ID | <20191020161930.08c7c549@nx-74205> |
| In reply to | #59923 |
On 20.10.2019 at 13:39, Carlos E.R. scribbled: > On 20/10/2019 12.33, Aragorn wrote: > > On 20.10.2019 at 01:15, Soviet_Mario scribbled: > > ... > > > > >> ...] but 10 y ago the native batch files to be parsed by > >> command.com were not as powerful and flexible as bash script. > > > > Of course. See higher up. DOS was a single-tasking environment > > and a much simpler operating system in every respect. > > Not only that. Back in the time, before we could compare with bash, > batch scripting was very limited and needed external helpers. For > example, for handling a menu of options, we had to use an external > program to query the keyboard, which would return a number, an > exitcode, not a letter; later a trick to obtain letters was invented. > Similarly the "language" would not allow entering text. I created menus by combining batch files with a GWBASIC program I had written. Those were my very first programs, and I had borrowed a lot from other people's ideas. :) -- With respect, = Aragorn =
[toc] | [prev] | [next] | [standalone]
| From | "Carlos E.R." <robin_listas@es.invalid> |
|---|---|
| Date | 2019-10-20 21:08 +0200 |
| Message-ID | <ntnu7g-gbj.ln1@Telcontar.valinor> |
| In reply to | #59928 |
On 20/10/2019 16.19, Aragorn wrote: > On 20.10.2019 at 13:39, Carlos E.R. scribbled: > >> On 20/10/2019 12.33, Aragorn wrote: >>> On 20.10.2019 at 01:15, Soviet_Mario scribbled: >> >> ... >> >>> >>>> ...] but 10 y ago the native batch files to be parsed by >>>> command.com were not as powerful and flexible as bash script. >>> >>> Of course. See higher up. DOS was a single-tasking environment >>> and a much simpler operating system in every respect. >> >> Not only that. Back in the time, before we could compare with bash, >> batch scripting was very limited and needed external helpers. For >> example, for handling a menu of options, we had to use an external >> program to query the keyboard, which would return a number, an >> exitcode, not a letter; later a trick to obtain letters was invented. >> Similarly the "language" would not allow entering text. > > I created menus by combining batch files with a GWBASIC program I had > written. > > Those were my very first programs, and I had borrowed a lot from other > people's ideas. :) I think used some tiny utility that came from PC Magazine to read the keyboard response. -- Cheers, Carlos.
[toc] | [prev] | [next] | [standalone]
| From | Aragorn <thorongil@telenet.be> |
|---|---|
| Date | 2019-10-20 21:51 +0200 |
| Message-ID | <20191020215136.7de8a943@nx-74205> |
| In reply to | #59943 |
On 20.10.2019 at 21:08, Carlos E.R. scribbled:
> On 20/10/2019 16.19, Aragorn wrote:
>
> > I created menus by combining batch files with a GWBASIC program I
> > had written.
> >
> > Those were my very first programs, and I had borrowed a lot from
> > other people's ideas. :)
>
> I think used some tiny utility that came from PC Magazine to read the
> keyboard response.
Yeah, I discovered that utility later. It would set an ERRORLEVEL
value, and you had to test for it in reverse numerical order, because if
it was ERRORLEVEL 100 and you tested only for ERRORLEVEL 99, you'd get a
false positive. And you still needed a batch file to do the test and
invoke the correct option.
My BASIC program would display the menu as well, with nice colors [*]
and a frame. :)
[*] Actually, it was an old XT clone that my dad got from his brother,
and even though it had an EGA graphics card in it, the monitor only
showed grey scales. So I didn't even know what the colors were,
except that some were darker than others for use as a background,
and others were highlighting colors, so they were good for a "bold"
effect.
--
With respect,
= Aragorn =
[toc] | [prev] | [next] | [standalone]
| From | "Carlos E.R." <robin_listas@es.invalid> |
|---|---|
| Date | 2019-10-20 22:12 +0200 |
| Message-ID | <mmru7g-6gm.ln1@Telcontar.valinor> |
| In reply to | #59951 |
On 20/10/2019 21.51, Aragorn wrote: > On 20.10.2019 at 21:08, Carlos E.R. scribbled: > >> On 20/10/2019 16.19, Aragorn wrote: >> >>> I created menus by combining batch files with a GWBASIC program I >>> had written. >>> >>> Those were my very first programs, and I had borrowed a lot from >>> other people's ideas. :) >> >> I think used some tiny utility that came from PC Magazine to read the >> keyboard response. > > Yeah, I discovered that utility later. It would set an ERRORLEVEL > value, and you had to test for it in reverse numerical order, because if > it was ERRORLEVEL 100 and you tested only for ERRORLEVEL 99, you'd get a > false positive. And you still needed a batch file to do the test and > invoke the correct option. > > My BASIC program would display the menu as well, with nice colors [*] > and a frame. :) I did not think of using basic, but I think now that I created my own menu helper in Turbo Pascal. > [*] Actually, it was an old XT clone that my dad got from his brother, > and even though it had an EGA graphics card in it, the monitor only > showed grey scales. So I didn't even know what the colors were, > except that some were darker than others for use as a background, > and others were highlighting colors, so they were good for a "bold" > effect. Mine was an Amstrad PC 1512 DD, if I recall the name correctly. It is actually sitting on another room, but I don't feel like getting up and going and "activating" the light source. And jumping over the exercise bike machine in the middle of the way. Yes, the video was CGA colour, improved, but I saved on the display and got only a BW (grays) one. -- Cheers, Carlos.
[toc] | [prev] | [next] | [standalone]
| From | John Hasler <jhasler@newsguy.com> |
|---|---|
| Date | 2019-10-19 12:33 -0500 |
| Message-ID | <878spgbpxs.fsf@dhh.gt.org> |
| In reply to | #59882 |
Soviet_Mario writes: > The origin of my confusion is that it resembles more the > MACRO / Preprocessor usage than the plain synthax. > > Is then a MACRO language to a certain degree ? No. a "macro language" is a set of macros which are expanded by a macro processor. man m4 to see the canonical example. Bash is an interactive shell with extensive scripting capabilities. -- John Hasler jhasler@newsguy.com Dancing Horse Hill Elmwood, WI USA
[toc] | [prev] | [next] | [standalone]
| From | William Unruh <unruh@invalid.ca> |
|---|---|
| Date | 2019-10-19 21:26 +0000 |
| Message-ID | <qofv1n$p8o$1@dont-email.me> |
| In reply to | #59870 |
It is a "progamming" language, and a scripting language. It is however slow and tends to rely on other programs to accomplish its tasks. But why do you care what it is called? Use it for jobbs for which it is suitable. Do not use it for those for which it is not. Big long programs are not its strength Ues something else. On 2019-10-19, Soviet_Mario <SovietMario@CCCP.MIR> wrote: > > Is it there sort of a "limit" about how much memory can be > used in BASH scripts (variable, functions and so). > > How heavy on memory is the heaviest script ever met ? > > sub topic. > > I'm still confused as to how just classify BASH (please for > once don't correct the capitalization, is just a way to add > emphasis in plain text without colors / bold, italics and so) > I mean, is it considered a true programming language ? A > scripting language ? what ? > I can recall initially also JavaScript/ECMAscript was > considered just a scripting (I dunno the exact difference > actually) but nowadays it has reached the programming > language status much like Java. > > what topics in general are not suitable for BASH ? > I mean, I think it is very fit for file system manipulation, > absolutely unfit for graphics. And for TEXTUAL elaboration ? > > The origin of my confusion is that it resembles more the > MACRO / Preprocessor usage than the plain synthax. > > Is then a MACRO language to a certain degree ? > > The questions are confused, I know :\ ... And why do you care what the answer is. What difference does it make? >
[toc] | [prev] | [next] | [standalone]
| From | Idaho Homo Joe <dick_lick@aol.com> |
|---|---|
| Date | 2019-10-19 21:47 -0400 |
| Subject | Linux users who buttfuck the president... |
| Message-ID | <qogeb1$168$1@gioia.aioe.org> |
| In reply to | #59906 |
Remember-ram it in hard & deep with no vaseline!
[toc] | [prev] | [next] | [standalone]
| From | Soviet_Mario <SovietMario@CCCP.MIR> |
|---|---|
| Date | 2019-10-20 15:19 +0200 |
| Message-ID | <qohms9$83v$1@dont-email.me> |
| In reply to | #59906 |
On 19/10/2019 23:26, William Unruh wrote: > It is a "progamming" language, and a scripting language. It is however > slow and tends to rely on other programs to accomplish its tasks. > > But why do you care what it is called? no, I'm "caring" about its nature to try to understand WHY with this language and not others I cannot get anything done. I mean, I self-taught basic, C, to a lesser extent C++, Pascal (and long ago somewhat Fortran 77, but I HATED IT ... never the less I understood it), but I absolutely cannot oriend in BASH. I just don't understand the logic, the philosopy underlying. I also completely fail to understand LAMBDA and functional languages, while I feel comfortable with so called "imperative" languages. So I'm suspecting sth in my mind-shape is not compatible with scripting shell, and I was trying to understand what. It's a vague question not easy to be expressed though in C++ the same occurred to me using a lot of MACRO preprocessor : I failed to figure out the GENERATED CODE. If sth is non directly visible I fail to prefigure the effects. with BASH i cannot even figure out the level of "indirections" (= how many time a certain expression will be expanded and why). And assumed I understood theoretically, it would still be beyond my prefiguration ability. > Use it for jobbs for which it is > suitable. Do not use it for those for which it is not. Big long programs > are not its strength Ues something else. > > > On 2019-10-19, Soviet_Mario <SovietMario@CCCP.MIR> wrote: >> >> Is it there sort of a "limit" about how much memory can be >> used in BASH scripts (variable, functions and so). >> >> How heavy on memory is the heaviest script ever met ? >> >> sub topic. >> >> I'm still confused as to how just classify BASH (please for >> once don't correct the capitalization, is just a way to add >> emphasis in plain text without colors / bold, italics and so) >> I mean, is it considered a true programming language ? A >> scripting language ? what ? >> I can recall initially also JavaScript/ECMAscript was >> considered just a scripting (I dunno the exact difference >> actually) but nowadays it has reached the programming >> language status much like Java. >> >> what topics in general are not suitable for BASH ? >> I mean, I think it is very fit for file system manipulation, >> absolutely unfit for graphics. And for TEXTUAL elaboration ? >> >> The origin of my confusion is that it resembles more the >> MACRO / Preprocessor usage than the plain synthax. >> >> Is then a MACRO language to a certain degree ? >> >> The questions are confused, I know :\ ... > > And why do you care what the answer is. What difference does it make? >> -- 1) Resistere, resistere, resistere. 2) Se tutti pagano le tasse, le tasse le pagano tutti Soviet_Mario - (aka Gatto_Vizzato)
[toc] | [prev] | [next] | [standalone]
| From | Dan Purgert <dan@djph.net> |
|---|---|
| Date | 2019-10-20 13:54 +0000 |
| Message-ID | <slrnqqoppi.1ug.dan@djph.net> |
| In reply to | #59925 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Soviet_Mario wrote:
> On 19/10/2019 23:26, William Unruh wrote:
>> It is a "progamming" language, and a scripting language. It is however
>> slow and tends to rely on other programs to accomplish its tasks.
>>
>> But why do you care what it is called?
>
> no, I'm "caring" about its nature to try to understand WHY
> with this language and not others I cannot get anything done.
> I mean, I self-taught basic, C, to a lesser extent C++,
> Pascal (and long ago somewhat Fortran 77, but I HATED IT ...
> never the less I understood it), but I absolutely cannot
> oriend in BASH. I just don't understand the logic, the
> philosopy underlying.
At some level, a bash script is simply some "glue logic" to operating on
the system; so you don't have to write all the commands out for
"everything".
For example, to rename all "*tar.gz" files to "*tgz":
for f in *tar.gz; do g=${f%%.tar.gz}; mv $f $g.tgz; done
Sticking that in a script ("rename") will do this:
$> ls
a.tar.gz b.tar.gz c.tar.gz d.tar.gz rename
$> bash rename
$> ls
a.tgz b.tgz c.tgz d.tgz rename
NOTE -> the "bash rename" command is done this way because in our
example, I haven't gone through the trouble to make the "rename" script
executable. You can make the script executable with the command "chmod
+x rename" and then just run it as "./rename" instead.
So, with "one command" (well, script), we renamed the four files,
instead of having to type it out every time:
$> ls
a.tar.gz b.tar.gz c.tar.gz d.tar.gz
$> mv a.tar.gz a.tgz
$> mv b.tar.gz b.tar
$> mv c.tar.gz c.tgz
$> mv d.tar.gz d.tar
$> ls
a.tgz b.tgz c.tgz d.tgz
That's it. Sure, there is some additional logic you can add in
(conditional statements, some basic math, etc.) to help control the
program flow, but in my experience, scripts tend to be "one liners" like
the above.
> [...]
> So I'm suspecting sth in my mind-shape is not compatible
> with scripting shell, and I was trying to understand what.
> It's a vague question not easy to be expressed though
TBH, it sounds more like you're just trying to make it harder than it
really is.
>
> in C++ the same occurred to me using a lot of MACRO
> preprocessor : I failed to figure out the GENERATED CODE. If
> sth is non directly visible I fail to prefigure the effects.
going from C(++) and then trying to understand the assembly output is a
considerably more complex task than understanding bash scripting.
>
> with BASH i cannot even figure out the level of
> "indirections" (= how many time a certain expression will be
> expanded and why). And assumed I understood theoretically,
> it would still be beyond my prefiguration ability.
So in the above script, there are two expansions we're working with:
1. The glob of "*.tar.gz" -- it only finds filenames ending with
"*.tar.gz". Other filenames (in the example "rename") are
ignored.
2. The parameter expansion of "${f%%.tar.gz}" -- it means "expand the
word contained in the variable, then delete the longest string of
characters matching .tar.gz from the end of the word". So in our
example, "a.tar.gz" would end up being "a" after going through
that parameter expansion.
NOTE -> in the script, we're assigning the variable "g" to the output of
the pattern, with the string ".tgz" tacked on the end, right before
issuing the command.
The actual execution of the script can be psuedo-coded as follows:
for f in *tar.gz <-- "for a.tar.gz, b.tar.gz, c.tar.gz, and d. tar.gz
do g=${f%%.tar.gz} <-- set g to the filename, less ".tar.gz"
mv $f ${g}.tgz <-- move the file named in variable "f" to the shortened
name held in "g", with ".tgz" tacked on the end
so, it does this
(first loop)
f=a.tar.gz
g=a
mv a.tar.gz a.tgz
(second loop)
f=b.tar.gz
g=b
mv b.tar.gz b.tgz
(third loop)
f=c.tar.gz
g=c
mv c.tar.gz c.tgz
(fourth loop)
f=d.tar.gz
g=d
mv d.tar.gz d.tgz
HTH
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEBcqaUD8uEzVNxUrujhHd8xJ5ooEFAl2sZzAACgkQjhHd8xJ5
ooFotAf/eoO3BOqJa9Mp5bODde60G4pe5dN3JGhM4w11bEM7WxUri2KA565IVCRB
Ew2zKhpkF6pqmv7rxyT86v4gGbv3owsXUJR73nOPZnnM3+Hk+rzVUWCieSswdpGD
r3iEQH5sAgMD8H9oWBBydvSNSD4HNMrAKWjD+KnAXKVhQsx0x1DFUNiPvwh0XQNb
bjVt24lAuz8tArmQj+GeM9O/+NxuF4NZonJOMhcN84cAHdYWGalJ1gtiMi7mV1ep
6M34j3YBMBRnbrjQhM8VFbWzsyiIzAgjsRaJxVRSU4/zN3puoWqMngKUX4yG+4Hg
9fjFW9Ds3zkM0BiYKcGozHDwt2YKwA==
=XTLt
-----END PGP SIGNATURE-----
--
|_|O|_|
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
[toc] | [prev] | [next] | [standalone]
| From | Richard Kettlewell <invalid@invalid.invalid> |
|---|---|
| Date | 2019-10-20 15:29 +0100 |
| Message-ID | <87zhhvwkvx.fsf@LkoBDZeT.terraraq.uk> |
| In reply to | #59925 |
Soviet_Mario <SovietMario@CCCP.MIR> writes: > On 19/10/2019 23:26, William Unruh wrote: >> It is a "progamming" language, and a scripting language. It is however >> slow and tends to rely on other programs to accomplish its tasks. >> >> But why do you care what it is called? > > no, I'm "caring" about its nature to try to understand WHY with this > language and not others I cannot get anything done. If you want to fully understand the language, fitting it into some poorly defined category will not get you very far. What you need to do is read and fully understand a specification document such as https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html > I mean, I self-taught basic, C, to a lesser extent C++, Pascal (and > long ago somewhat Fortran 77, but I HATED IT ... never the less I > understood it), but I absolutely cannot oriend in BASH. I just don't > understand the logic, the philosopy underlying. It still sounds like you would do better by choosing a more appropriate language for your task. But I already suggested that and yet here we are. -- https://www.greenend.org.uk/rjk/
[toc] | [prev] | [next] | [standalone]
| From | William Unruh <unruh@invalid.ca> |
|---|---|
| Date | 2019-10-20 19:24 +0000 |
| Message-ID | <qoic98$r0$1@dont-email.me> |
| In reply to | #59929 |
On 2019-10-20, Richard Kettlewell <invalid@invalid.invalid> wrote: > Soviet_Mario <SovietMario@CCCP.MIR> writes: >> On 19/10/2019 23:26, William Unruh wrote: >>> It is a "progamming" language, and a scripting language. It is however >>> slow and tends to rely on other programs to accomplish its tasks. >>> >>> But why do you care what it is called? >> >> no, I'm "caring" about its nature to try to understand WHY with this >> language and not others I cannot get anything done. > > If you want to fully understand the language, fitting it into some > poorly defined category will not get you very far. What you need to do > is read and fully understand a specification document such as > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html I would simply start reading some simple bash script, and use the man page (or a simple book) to delve into the scripting process. > >> I mean, I self-taught basic, C, to a lesser extent C++, Pascal (and >> long ago somewhat Fortran 77, but I HATED IT ... never the less I >> understood it), but I absolutely cannot oriend in BASH. I just don't >> understand the logic, the philosopy underlying. > > It still sounds like you would do better by choosing a more appropriate > language for your task. But I already suggested that and yet here we > are. If he hasd told us what his task was this might be good advice, but he hasn't. He has gone off on a jag where his concern is about what linguistic category to shelve the concept of a bash script, as if that will help for anything. Just as knowing that C is in the same category as C++ and Fortran, or even Lisp or Perl, is of no help in figuring out how to code in those languages, sticking bash into some category is not going to be terribly helpful in writing a bash script.
[toc] | [prev] | [next] | [standalone]
| From | Richard Kettlewell <invalid@invalid.invalid> |
|---|---|
| Date | 2019-10-21 10:28 +0100 |
| Message-ID | <87o8yawipe.fsf@LkoBDZeT.terraraq.uk> |
| In reply to | #59948 |
William Unruh <unruh@invalid.ca> writes: > Richard Kettlewell <invalid@invalid.invalid> wrote: >> Soviet_Mario <SovietMario@CCCP.MIR> writes: >>> no, I'm "caring" about its nature to try to understand WHY with this >>> language and not others I cannot get anything done. >> >> If you want to fully understand the language, fitting it into some >> poorly defined category will not get you very far. What you need to do >> is read and fully understand a specification document such as >> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html > > I would simply start reading some simple bash script, and use the man > page (or a simple book) to delve into the scripting process. With questions like “many time a certain expression will be expanded and why”, he needs reference material, not an introduction. >>> I mean, I self-taught basic, C, to a lesser extent C++, Pascal (and >>> long ago somewhat Fortran 77, but I HATED IT ... never the less I >>> understood it), but I absolutely cannot oriend in BASH. I just don't >>> understand the logic, the philosopy underlying. >> >> It still sounds like you would do better by choosing a more appropriate >> language for your task. But I already suggested that and yet here we >> are. > > If he hasd told us what his task was this might be good advice, but he > hasn't. My advice is because he’s obviously struggling badly when using Bash for his task. That suggests he needs to use another language, better suited to the combination of the task and himself. It doesn’t really matter whether he’s incompatible with shell or his task is (which wouldn’t be surprising; it’s a bad fit to most tasks); either way, it’s evidently not working out well. -- https://www.greenend.org.uk/rjk/
[toc] | [prev] | [next] | [standalone]
| From | Chris <ithinkiam@gmail.com> |
|---|---|
| Date | 2019-10-20 15:36 +0100 |
| Message-ID | <qohrdb$v2m$1@dont-email.me> |
| In reply to | #59925 |
On 20/10/2019 14:19, Soviet_Mario wrote: > On 19/10/2019 23:26, William Unruh wrote: >> It is a "progamming" language, and a scripting language. It is however >> slow and tends to rely on other programs to accomplish its tasks. >> >> But why do you care what it is called? > > no, I'm "caring" about its nature to try to understand WHY with this > language and not others I cannot get anything done. > I mean, I self-taught basic, C, to a lesser extent C++, Pascal (and long > ago somewhat Fortran 77, but I HATED IT ... never the less I understood > it), but I absolutely cannot oriend in BASH. I just don't understand the > logic, the philosopy underlying. > > I also completely fail to understand LAMBDA and functional languages, > while I feel comfortable with so called "imperative" languages. > > So I'm suspecting sth in my mind-shape is not compatible with scripting > shell, and I was trying to understand what. > It's a vague question not easy to be expressed though > > in C++ the same occurred to me using a lot of MACRO preprocessor : I > failed to figure out the GENERATED CODE. If sth is non directly visible > I fail to prefigure the effects. > > with BASH i cannot even figure out the level of "indirections" (= how > many time a certain expression will be expanded and why). And assumed I > understood theoretically, it would still be beyond my prefiguration > ability. Maybe if you came up with some command you don't understand or a task you wish to achieve with bash, someone can give some feedback or worked examples. You're talking in unclear generalities which makes it difficult to understand what you mean. As others have said bash is an interpreted language which requires scripts being passed to the interpreter to be run. It is *also* a shell where commands can be typed directly at the commandline to achieve your needs. The same commands can be used in the shell or in a script.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | alt.os.linux
csiph-web