Bash Shell vs Bourne
Hi, simple question for someone a little more knowledgable than me. I am very eager to learn some advanced shell scripting techniques. I have been scouring the web for a good book to teach me this, and i have come across one that is very highly praised: callled UNIX Shell Programming, written by Kochan and Wood. It is based on the Bourne shell. I am running Bash, and i am aware it is a descendant from Bourne. But my question is this, how different are the two? Do you think i should buy that book or look for one specifically on the Bash shell? Are there such dramatic differences between the 2 shells that i would find myself having to drastically reinterpret some of things in that book? I only ask b/c that book is so highly praised and many of the books that i find about simply Bash have some harsh criticism by readers.
|
There are no dramatic differences, just that Bourne Again Shell (bash) had become more user friendly (autocomplete feature, etc), hence it is a default shell on most Linux installs. As for the book get it in any case.
|
Why do you want a book?
The fact that you are able to post here shows that you have access to the biggest library known to man. |
Bash is a "modernized" Sh and "echo" seems to be it's only real PITA mentioned AFAIK. Scripts running in Sh will run in Bash, but the other way around shouldn't be assumed automatically (as goes for any script compatibility I guess). If you've not read seen these sites, I'd say go there first, *then* buy the book:
Advanced Bash Scripting Guide (ABS): http://www.tldp.org/LDP/abs/html/ Heiner's SHELLdorado: http://www.shelldorado.com Linuxguru's shell scrip resources: http://www.linuxguruz.org/z.php?id=911 |
Quote:
|
here's a quick set of lessons to get started:
http://linuxcommand.org/writing_shell_scripts.html :cool: |
Quote:
1 book - 1 way to reach a solution. 3 book - 3 ways to reach a solution. Internet - Every way to reach a solution. But who am I to say use the net - Use whatever you feel comfortable with :) |
Quote:
For example, I picked up a book on Samba Server Administration. It had nothing that you can't find online..but it put it together in such a way that I understood it faster...which then allowed me to go online and find any missing information. Another good example is "Running Linux" from Oreilly. An awesome basic reference book for the beginner...because sometimes you need more than just being able to ask questions...you need to know what you need to ask. |
there's a good bash howto on the web
|
i've been whizzing thru all these guides....they are good at introducing the ideas but i've been progging C++ for almost 3 years now so its all easy stuff. what im interested in is this kind of stuff: when u execute a command, such as ping xxx.xxx.x.xxx, how can u grab that info that comes back in a script? or when i try to telnet to a port? -how can i get the value that it returns? such as was the session succesful? or if i telnet into the port, how do i then enter more commands and check their success? etc... the list goes on and on
|
Learning the bash Shell, 2nd Edition
By Cameron Newham, Bill Rosenblatt 2nd Edition January 1998 1-56592-347-2, Order Number: 3472 334 pages, $29.95 US, $42.95 CA, £20.95 UK http://ftp.nchu.edu.tw/ftp/Documenta...nutshell/bash/ |
thnx whansard, i will be buying that. but for now, i have figured out how to extract the output using the `command` , but i cant figure out how to send another command once i've gotten into telnet. anyone know? so far i have this:
script_name=`telnet wcsu.edu 25` #need something here to enter "quit" command ?? echo "Telnet output is";echo "$script_name" script_name=`telnet wcsu.edu 25` sleep 3 #echo "quit"; echo <-tried this to get it to quit, doesn't work result=`quit` <-trying this...not working, just hangs echo "Telnet output is"; echo "$script_name" |
Try using "expect" rather than bash. "expect" is designed to act interactively with other programs.
|
Having said that - you may be better with ssh depending on what you want to do.
|
yup i just d/l expect and tcl earlier today. still trying to figure it out, it seems cool tho.
|
All times are GMT -5. The time now is 03:40 AM. |