Best way to learn UNIX and shell Programming | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Best way to learn UNIX and shell Programming

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-05-2011
dnam9917 dnam9917 is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 2 March 2012, 12:41 AM EST
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
Best way to learn UNIX and shell Programming

Guys,

What do you think is the best way to learn UNIX and shell scripting?

** I keep on searching tutorials online, where I loose most of my time

Let me know the way you learnt the UNIX concepts, your replies might help me learn more.

Thanks a ton
Sponsored Links
    #2  
Old 09-05-2011
kermit's Avatar
kermit kermit is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 22 May 2014, 9:43 PM EDT
Posts: 40
Thanks: 1
Thanked 4 Times in 3 Posts
Disclaimer: I am not a professional UNIX guy - I work in a completely different field.

From my perspective, the number one most helpful thing you can do is to be constantly coding. This is particularly helpful if you have a need (or at least desire) some particular behaviour in your system. For example, I had a buggy program, and sometimes would need to kill several instances of it. It was a pain to do a `ps -A` every time, and manually kill each instance of the process. So I made a one-line script that would do a ps -A, grep for the name of the particular process, parse and grab the pid from the first field, and then do a kill on those numbers. Over time, I polished and extended the script, adding functionality, and making the output a little more informative/easier to read.

Now there a few things to note here:
  1. At the time, I did not know of pkill and friends, so I was basically reinventing the wheel. As I look back, that was OK, because I learned something while doing it. In fact, it is a decent way to learn. You basically take a known utility that you normally use, eg., pkill, or whatever, and re-implement it yourself. At first, your new program likely won't have all of the functionality of the full blown version on your system, but you can add that over time. This concept is also helpful in other areas, such as C programming. It is very instructive, for example, to make your own versions of the string library functions. Not for actual use necessarily, but for learning. (It is hard to beat the system versions, in terms of outright speed. If you already know enough to improve on the standard library, then my points here are basically moot.)
  2. If the process of learning how to shell program seems to be coming slowly, remember to be patient with yourself, and stick with it. Everybody's situation is different. For my part, I am a slow learner (it seems), and I have been hacking away for years and am not nearly as far as others have gotten in the same time. If I was doing this for a living, I know I would be farther along, because a), I would be immersed in it, and b) I would (ostensibly) have other professionals to guide me when I was doing something that was not quite right. This is true of mostly any profession I think. There is a huge learning curve with this sort of thing - lots of nooks and crannies. Be patient!

So that is my two cents worth. Write lots of code. It would be preferable to be writing some useful little stuff which improves some particular situation of your own (as opposed to toy exercises, which initially can be somewhat helpful, but are ultimately limited in value). If you are like me, you likely want to grab an O'Reilly book on scripting, or something like that as well. Ask lots of questions as well.
Sponsored Links
    #3  
Old 09-05-2011
durden_tyler's Avatar
durden_tyler durden_tyler is offline Forum Advisor  
Registered User
 
Join Date: Apr 2009
Last Activity: 30 July 2014, 11:47 AM EDT
Posts: 1,840
Thanks: 7
Thanked 265 Times in 240 Posts
(a) Spend some bucks to buy a good book on Unix/Linux. Check out the reviews, the "Look Inside" feature, the "Listmania" lists at amazon.com. Or go to your neighborhood bookstore and browse through the books to get an idea of the one that suits you.

But, more importantly:

(b) Install a Unix/Linux system on your computer yourself, and practice, practice, practice. Write as many scripts as you can. Test things by yourself before believing anything.

It's like learning how to ride a bicycle or swim. A book can only give you the directions, but when the time comes, it won't write your Production code for you.

tyler_durden
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX shell programming ashokkrishna063 Shell Programming and Scripting 2 06-29-2011 07:48 AM
How can I learn computer programming languages on my own? Anna Hussie What is on Your Mind? 5 06-04-2011 09:21 AM
What web programming languages should i learn? Anna Hussie Web Programming 1 05-04-2011 05:08 AM
Programming/Scripting Languages To Learn tjinr UNIX for Dummies Questions & Answers 1 07-24-2006 12:32 PM
Want To Learn Network Programming hubin330 Programming 2 12-20-2003 12:04 PM



All times are GMT -4. The time now is 09:17 PM.