what is shell scripting?
What is shell scripting? what is 'bash'? :study:
|
Hello,
Asked and answered a million times before. Please put in some work and Google, there are so many documents online that go into detail on what shell scripting and Bash is. Kind regards, Eric |
It's God's judgment on humanity. And use a web search like DuckDuckGo.
|
BASH: Bourne Again shell
Bash is a type of shell in Unix/Linux. A shell in Linux/Unix means something which takes as input the user specified commands, executes them and gives us the output. Every command recognized by the shell is actually a program whose executable is stored in the folders like /bin. Example: ls is a command which lists all the files in a folder. So here we are using ls command to list out all the folders in the root directory. (root directory is represented by / in bash, so when we say, /bin, it means the bin directory in the root folder) Code:
anisha@linux-uitj:~> ls / Example: In the below example notice the ls command itself listed inside the /bin folder as an executable. Code:
anisha@linux-uitj:~> cd /bin The commands recognized by the shell usually call dozens of other functions dealing directly with the Linux kernel. It looks too simple??, to know which functions does ls call "internally" to get the list of the files, there is another command named 'strace': The titles which you see in red colour below are actually the functions called by ls, internally. Code:
anisha@linux-uitj:~> strace ls 1. http://tldp.org/LDP/Bash-Beginners-Guide/html/ 2. http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html 3. http://tldp.org/LDP/abs/html/ |
@Anisha: Do you think the OP even can _read_ the script. Heck, I gave up after the second line. I have however bookmarked the page and will read this later.
@OP: Bash scripting is something *nix folks do. It is actually used to scare newbies like you. Hang in there, you would eventually understand. |
Quote:
Quote:
|
Quote:
Sorry to disagree with you but what Anisha posted was in my opinion a very clear and more then complete explanation of what Bash is, and all of that in easy to understand terms. Heck, it's a lot more then what I would post to explain something that's basic knowledge and easy to find on the internet (hence my previous post). Making a statement like you do, bringing down the importance of Bash (and for what it's worth other shells), gives a very wrong image of Linux/Unix. How is OP to understand like you point out he eventually will, when you 'bash' a perfectly good basic explanation? Kind regards, Eric |
kernel and shell
Quote:
http://www.freeos.com/guides/lsst/ :)good luck:) Google "shell scripting" and "bash" without the parentheses |
Eric, thank you, for the soothing words you wrote as a comment in the reputation column. I enjoyed them so much that I was forced to make this post, just to thank you.
|
Hi Anisha,
No thanks necessary, in my opinion you did a great job with that post in very understandable words. Should be appreciated by all newbies looking for a simple explanation of something that can go to very high complexity. Thank you for taking the time to post it. I'm sure a lot of users will agree with me. Statements like SilverBack's one don't add to the valor of Linux at all. Kind regards, Eric |
Document
1 Attachment(s)
here is the pdf "Introduction to bash scripting" this should give you a good foundation along with Anisha's examples
|
Hi citi,
Very nice, thanks for sharing it. I'm sure it'll be of use to someone. Kind regards, Eric |
But it still seems very odd and inappropriate to introduce a newbie to bash using strace...
Anyway, bash is the program that interprets the commands you type at a terminal, and a shell script is a file full of commands that can be run by the shell so you don't have to type them one by one. Like Anisha said, commands are actaully executable programs in certain directories. But some are built into the shell. The shell also has syntax for variables, if-then-else statements, wildcards, math, etc. |
Quote:
I thought it was a nice touch using strace to show that it's not all that simple as just using ls but that there's a 'world' of complex things below what we use on a regular basis. Something about what most newbies don't even think about but can be very useful information. If you want to tame the beast it's best to understand it's nature :) Kind regards, Eric |
Your welcome Eric, just trying to help in any way possible
|
All times are GMT -5. The time now is 11:48 PM. |