@theKbStockpiler
I think you're trying to be way too philosophical about this. BASH is just a program to conveniently launch other programs. That's it. |
Quote:
I'd like to add that theKbStockpiler also uses terminology that is not generally accurate, and probably perpetuates many of his misunderstandings. For example, the phrase 'when you open a BASH Application directly', which I think must mean 'run a text-mode application from a shell commandline'. Conceptually, 'open' and 'run' are distinct, where running implies execution of code, and opening is simply creating an access point to a file. Other than shell scripts, there is really no such thing as a 'BASH Application'. Bash holds no special relationship with any application that I know. Another broad misunderstanding that I believe the OP holds is that Bash somehow contributes something to the runtime 'environment' (where the term is used in a general sense, not referring to the actual memory space holding variables and other data). Such is not the case. A text-mode application's only attachment to the shell that launched it is that the shell is its parent process and provider of its arguments. The shell that launches an application may set up certain environment variables, establish some particular host configuration such as terminal configuration or behavior, and passes arguments to the launched process, but does not provide any kind of services to the child process. There is no API that provides access to the parent shell. Actually, this is true of any application, text-mode or GUI, launched by Bash or other common shells. A shell is the common term for applications that provide a commandline user interface. Bash is the shell most commonly used in Linux. It is the more recent version of the Bourne Shell, and the name is actually a sort of acronym for "Bourne Again SHell". Other common shells are Korn shell, and C-Shell. The little programs that most shells are capable of interpreting are what we call scripts. I'm not sure I understand your last question, but I think you asked whether I really meant writing shell scripts, and not an actual shell. This is not what I meant at all. I meant that a constructive exercise is to write an actual simple shell. You could call is theKBSShell. --- rod. |
Why BASH? Because what you need to do is 'trivial' and repetitive...
Okay...
@theKbStockpiler & Sergei: The concept of shell-scripting, especially as it pertains to Systems Administration, is the idea that you are likely going to have to do several repetitive tasks over and over again that you *could* do from the CLI, but would rather put your skills to use by automating as much as you can into a shell script. This should make you more efficient and your job much easier. Now, as has been pointed out, BASH can call any executable on a system, so it has the capability of being *very* powerful, and if improperly used, can cause data loss, data corruption or system instability. So, when I say 'trivial' above, I refer to the System Administrator's perspective of the task at hand being accomplished within 15-20 minutes from the CLI, and not that the end-users won't even notice if the task was accomplished or not. As an example, a common task for System/Network Administrators is the updating of DNS records. The good admins that I have met keep a zone-file entry in a secured CVS/SVN/etc. server to keep track of changes in DNS, as well as make sure they have something to go back to should something go seriously wrong in the update. (Does anyone remember when Micro$oft pushed out a DNS update that killed access to Hotmail for a couple days? :p Well, there you go!) A BASH script is a perfect tool for such a task: You make the changes to the copy of the zone-file in your local filesystem, then fire off the script to check-in the updates to CVS and push it to the DNS server. The script would save you about 10-15 minutes for each update. Another quick example is a situation where you have a filesystem with a couple terabytes of images, and every image should have a thumbnail. Then, an end-user sends you an email stating that some images they need don't seem to have thumbnails. You check logs and find that there had been a few days of images being added, but no thumbnails were generated. So, you now have a couple options:
So, when it comes to the SysAd's toolbox, I tend to think of BASH as being the Phillips-head screwdriver. Hugely useful, but, as also stated above, not the right tool for every situation. It certainly can save you *hours* of work if used correctly. Now, if you want to build your knowledge and skills with BASH, I recommend going through The Advanced BASH-Scripting Guide at The Linux Documentation Project. An excellent guide with examples and plenty of exercises to try. I still use it as a reference now and again. Check it out. HTH. |
Quote:
On a resource limited embedded system I might be forced to write in 'sh'. |
Quote:
--- rod. |
Quote:
perl shell - you'll find more than one. Also, PDL (Perl Data Language) has an interactive shell as default. And, of course, one can simply write: Code:
for(;;) |
double post
|
Or is it just a catchy image?
Thanks for all the great replies. Although I don't believe that what I think bash is and what other members believe it is , is the same, the context I received helped form an opinion of it in which I believe I should be able to utilize.
I think Jeremy; as in LQ's Jeremy, has it" summed"up with the LQ logo. The Penguin is the same penguin that is gradually being overcome with the answer in steps with the help of other members. The Penguin has to come to the understanding it's self and that is the way knowledge works "internal understanding". |
Quote:
?????????????? What does this discussion have to do with Linux specifically ? How is it different for Solaris, *BSD, AIX, HPUX, etc. ? |
korn shell is nicer than bash for scripting
:-) My rules of thumb: messing about with files: shell messing about with strings: perl messing about with bytes: C/C++ |
@theKbStockpiler: I understand what you mean about bash ;)
|
<deleted>
|
Quote:
Correction, I think... Code:
my $line_to_be executed = <STDIN>; # should be $line_to_be_executed ??? In the following, the tokens '<Enter>' should be interpreted as me pressing the 'Enter' key Code:
perl -e 'for(;;)<Enter> |
Quote:
But my approach is different - I have a 'junk.pl' file in which I try little Perl code snippets, e.g. regular expressions and test cases for them. I find it to be actually time saving - editing in my favorite text editor and not having to deal with shell quoting issues is a relief. |
All times are GMT -5. The time now is 11:02 AM. |