Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
Originally posted by david_ross 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.
-well i am very grateful for the help that i have gotten here. but u cant ask questions without knowing what to ask them about! i understand basic shell scripts and im learning perl as we speak, but im interested in making some complex scripts. and there are so many different commands/shortcuts for doing things that i need somewhere to start learning about them rather than just asking questions aimlessly on here. for example i wanted to write script that will login to my stock account for me and send me an email if certain things have changed. there's about a billion other projects in waiting in my head, and most of the resources i find on the net arent that thorough. But that 1st link that unSpawn has given me seems to be a book in itself! much thnx i will be using that one for now . is it just me or does anyone else like having a book around? i personaly have at least a dozen or more books from C++ to perl to MySql in addition to the countless printouts of webpages. which is always nice when u have a crappy internet connection like me that goes down at the most inopportune times
That's what I was talking about! I didn't mean to ask every question on LQ but there are so many resources on the internet - especially on technology subjects - I don't usually use books.
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
Originally posted by david_ross That's what I was talking about! I didn't mean to ask every question on LQ but there are so many resources on the internet - especially on technology subjects - I don't usually use books.
I agree with you mostly, but I find that some books really wrap up details in an organized way that will click better than reading a how-to on the net.
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.
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
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
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
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"
Last edited by infamous41md; 04-10-2003 at 10:00 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.