I am currently learning java. But I always see mentioned that you should learn one programming language a year. So my question is it ok to learn bash with java or should I wait a year before I tackle it?
Nothing should stop you from learning more!
As long as you feel you'll be able to learn more than one language at a time, go for it. However, if you feel that you're spreading yourself too thin, then stick to the languages you want to learn at the moment and concentrate on it.
The whole "learn a language a year" thing is to keep people learning and prevent stagnation of one's programming skills, and also to open up one's mind to programming languages and paradigms offered by various languages.
It's going to be up to your judgment whether or not you can learn Java and bash scripting at the same time.
Bash and Java are completely unrelated, so learning one shouldn't interfere with learning the other. I don't see any reason why you can't learn both at the same time. There are many examples of both on the internet for learning purposes.
If you don't already know a shell scripting language, I think it is a very good idea.
You don't need to learn everything about bash at once, you can just learn the features you need to make your life easier as you find a need.
Bash is a great language to learn right now, because it can have immediate payoffs. With just a little knowledge of bash, you can write scripts that are actually useful to you. It is an good language to learn incrementally, as you need it.
There are some great guides on bash at The Linux Documentation Project.
A few points:
Bash and Java are almost completely unrelated (although you might make use of Bash to help glue pieces of your Java toolchain together). There's no overlap. In fact, the differences between the two might help you better appreciate the differences between a procedural-style approach (the primary paradigm of Bash) and an object-oriented approach (the primary paradigm of Java).
Learning a shell scripting language is very useful, especially in the Unix environment's rich toolset. Such languages effectively bring together many smaller tools to give you a powerful Swiss army knife of possibilities. If you find yourself frustrated by something small and nagging, or you want to automate a boring and repetitive task, chances are high that a scripting language can take care of the issue.
Don't worry about "learning too much". That's probably the best kind of problem you can have! You'll know when you've reached your saturation point for knowledge. And you just might find that the opposite is true -- you've gotten more curious and knowledgeable about the way things work, and are ready to move onto bigger projects.
While learning to program initially it's always a good idea to stick with one language until you learn all the fundamental concepts of programming and get familiar enough with the language that you are comfortable programming in it. Once you have coded a few moderate sized projects you can safely move onto other languages. New languages are always easier after learning your first language. It usually doesn't take a year to get familiar with a language. If you feel you are familiar enough with Java to learn a new language than do it!
The more you learn the better a programmer you are.
Ask yourself these questions.
- Do I understand Java enough to use it efficiently in a project on the fly?
- Have I researched x language and understand what it is before I commit to learning it?
If you answered yes to both those questions than go ahead and start learning it. If you've been with Java for a decent amount of time then it wont hurt a bit to learn a new language. Bash is a nice choice, but I don't think you can really call it a programming language, it's a command line scripting language but it's useful to linux developers and a must-know.
You can never learn too much.
Have fun learning :)
The most natural way to learn a new language, for me, has always been need. When the language you're using isn't all that great a fit. C++ is great for a lot of things, but it's sort of cumbersome for directory scanning.
For me, the the reasons to learn shell scripting included:
1. It is syn-tactually similar to C, so your knowledge extends itself later.
2. It is run for free on any Linux distribution, and will not require you to compile.
3. It is extensively documented.
4. IT EMPOWERS YOU TO GLUE TOGETHER ANY APPLICATIONS YOU CAN USE FROM THE COMMAND PROMPT
Think of the sheer number of open source applications available from the shell prompt: ntp, mail (postfix/mutt), web (lynx, apache), security (nmap), graphical (GNUPLOT), programming (awk), serial, etc. If you become fluent at transporting data between a huge number of more specialized applications, is there any one task you cannot perform for the cost of a linux box?
If you really looking for some book to learn bash, suggest to use http://tldp.org/LDP/abs/html/ . It is always my first choice.