Which book is suitable for someone starting out programming and scripting in Linux?

fallah December 31, 2010

I want to learn Linux scripting and other related works. I really like to learn how to program in Linux? Furthermore, I want to install ns2 on Linux.

  1. Joe
    January 7, 2011 at 10:38 pm

    Can't answer directly, but the O'Reilly books have been very good to me.

    As a first step, become more familiar with Linux and find out what languages were used to write applications similar to those you might like to write. Some popular ones are javascript, C, C++, python, and perl. There are many others.

    Currently, I program in bash, the main command shell language for most current Linux distributions. You can get a lot done very quickly by stringing together programs that are already available and you can even use some utilities to add graphic front-ends to your programs. It's very easy to get started with it once you are familiar with some Linux command line tools. Some cons: It's an interpreter, so it's not as fast as compiled languages. Depending on what you're doing, your original line of code may get expanded several times for wild cards, quoted expressions, etc.. This can quickly get pretty obscure and tricky to debug. It's great for smaller tools or to get an application that almost does what you want to do exactly what you want, but I wouldn't use it for a large application.

    I have a small project (somewhere around 1500 lines of code) using bash at
    which allows some printers that don't directly support printing on both sides of the page (duplex printing) to do so with a few enhanced features. It's a work in progress.

    If you do decide to learn C (without the ++ or #), The original (ancient) text by Kernighan and Ritchie is wonderful. It will take you through the basics with examples that all work right out of the text. When you are ready to write programs that interact more with system services, do graphics, etc., you'll need a more advanced, newer, book, but it's a great place to start.

    You can find free tutorials and even some free books on other popular languages on the web.

    The first step is to become as familiar as possible with Linux itself - including the command line, because whatever language you choose is going interact with that environment.

    There are a great many tools already written that will do large parts of what almost any new program needs to accomplish and most languages will let you run them from within your program either through libraries of routines or by directly running the programs from within your program, sending them input to process and capturing their output in files or directly back into your program. That's part of the genius of UNIX/Linux - the ability to easily use other people's programs as-is as parts of your new program without having to re-invent the wheel over and over again. Of course, to use them, you have to know that they exist and get used to searching for the ones you don't already know about.
    Google-Linux ( [BROKEN LINK REMOVED] ) is your friend. You can access it directly or with an icon on the Google Toolbar.