UnderGround Forums
 

ITGround >> help! unix, scripting crash course for interview!


5/14/11 5:58 PM
Ignore | Quote | Vote Down | Vote Up
StephenL
Send Private Message Add Comment To Profile

Member Since: 4/1/02
Posts: 24984
 
i'll be interviewing for an awesome position next week.

in addition to routing questions, they'll be asking about unix and scripting.

i have 0 days experience with each.

what to concentrate on to get through this 4.5 hour, yes 4.5 hour, interview?

stephen
5/15/11 3:22 AM
Ignore | Quote | Vote Down | Vote Up
cypherpunk
Send Private Message Add Comment To Profile

Edited: 05/15/11 3:26 AM
Member Since: 5/2/05
Posts: 23010
If you can find this very small book, read it.

The Unix Philosophy

Let it be the foundation for your Unix knowledge.
5/15/11 3:34 AM
Ignore | Quote | Vote Down | Vote Up
cypherpunk
Send Private Message Add Comment To Profile

Member Since: 5/2/05
Posts: 23011
Then, practice using the command line to do something useful for you. The thing that upsets me is that you're only giving yourself 1 week to learn this stuff. That's far too little time to learn much of anything.
5/15/11 11:33 AM
Ignore | Quote | Vote Down | Vote Up
StephenL
Send Private Message Add Comment To Profile

Edited: 05/15/11 11:35 AM
Member Since: 4/1/02
Posts: 24996
i like to go into new jobs knowing about 50-60% of it.

knowing 100% will get boring in 2 days.

stephen
5/15/11 2:26 PM
Ignore | Quote | Vote Down | Vote Up
Ho Kogan
Send Private Message Add Comment To Profile

Member Since: 11/2/10
Posts: 291
What operating system and what shell? bash, tcsh, ksh, etc...?
5/15/11 10:30 PM
Ignore | Quote | Vote Down | Vote Up
cypherpunk
Send Private Message Add Comment To Profile

Member Since: 5/2/05
Posts: 23012
Also, what DO you know? Can you program?
5/17/11 11:38 AM
Ignore | Quote | Vote Down | Vote Up
StephenL
Send Private Message Add Comment To Profile

Member Since: 4/1/02
Posts: 25018
i'm a cisco, arris, motorola router, switch and cmts guy.

no unix, no programming.

stephen
5/17/11 2:15 PM
Ignore | Quote | Vote Down | Vote Up
Anarkis
31 The total sum of your votes up and votes down Send Private Message Add Comment To Profile

Member Since: 1/22/05
Posts: 1969
Find a version of Unix that would be used in an Enterprise environment. SUSE, Solaris, Red Hat, E.T.C. Image a box or buy VM Workstation. (Cheaper then you think) Try to find information on automating and customizing installation, performing typical administrative functions with scripting, and just practice them. No one ever ask for specific examples of code. They want you to be able to express an understanding of the environment and how to automate it.
5/17/11 7:40 PM
Ignore | Quote | Vote Down | Vote Up
cypherpunk
Send Private Message Add Comment To Profile

Member Since: 5/2/05
Posts: 23017
I concur with Anarkis, and I want to emphasize the importance of PRACTICE. You have to put yourself in front of a shell and take your first baby steps. I googled around for a decent intro, and I thought this one was decent:

http://www.ks.uiuc.edu/Training/Tutorials/Reference/unixprimer.html

This will teach you the basics of navigating a file system using a shell. When you understand everything in that primer, you will be like a baby who has just learned to crawl. I don't want to sound harsh, but I am trying to be honest about where your skill level will be.
5/17/11 9:41 PM
Ignore | Quote | Vote Down | Vote Up
cypherpunk
Send Private Message Add Comment To Profile

Edited: 05/18/11 1:10 AM
Member Since: 5/2/05
Posts: 23018
http://shells.red-pill.eu/

PRACTICE

or rather...

play around. (Have fun with it.)

The shell is capable of a lot if you learn how to use it.

There are very good reasons this seemingly primitive interface REFUSES to disappear.

The shell allows you to express your intentions to a computer in ways that are difficult to impossible with a GUI.

If you learn it well, you will be rewarded.
5/19/11 7:54 PM
Ignore | Quote | Vote Down | Vote Up
StephenL
Send Private Message Add Comment To Profile

Member Since: 4/1/02
Posts: 25029
thank you.

my local borders and b&n did not have the unix book.

this is great info.

stephen
5/22/11 2:57 PM
Ignore | Quote | Vote Down | Vote Up
cypherpunk
Send Private Message Add Comment To Profile

Member Since: 5/2/05
Posts: 23034
Have you written your first shell script, yet?
5/26/11 8:55 PM
Ignore | Quote | Vote Down | Vote Up
StephenL
Send Private Message Add Comment To Profile

Member Since: 4/1/02
Posts: 25052
nope, just have lots of reading to do.

stephen
5/26/11 11:09 PM
Ignore | Quote | Vote Down | Vote Up
cypherpunk
Send Private Message Add Comment To Profile

Edited: 05/26/11 11:11 PM
Member Since: 5/2/05
Posts: 23047
Let's practice.


What does this do?

ls /usr/bin


And this?

ls /usr/bin | grep ^g


How about this?

ls /usr/bin | grep ^g | xargs echo


Now try this:

ls /usr/bin | grep ^g | xargs apropos

6/11/11 9:55 AM
Ignore | Quote | Vote Down | Vote Up
notsodirty
1 The total sum of your votes up and votes down Send Private Message Add Comment To Profile

Member Since: 11/28/10
Posts: 436
Ask him to explain the differences between UNIX-based and UNIX-like systems and why POSIX is important in this aspect.

A lot of people can do BASH/SH scripting fairly well, but they assume that what works for one system will work on every other system, which is completely wrong and dangerous. You're writing code for high portability and maintainability. Needing to re-write code, just to make it work is neither.

POSIX dictates a set of rule that every UNIX-based and almost all UNIX-like (Linux,BSD) systems should support, as well as the tools being shipped with these systems. For example:

sed -i (in file editing) is supported on a lot of systems, but not all. So that is why the better solution is to use:
sed 's/replace//' file > file_copy && mv file_copy file

These are things that can tell you if a person is a good programmer.







6/12/11 10:19 PM
Ignore | Quote | Vote Down | Vote Up
cypherpunk
Send Private Message Add Comment To Profile

Member Since: 5/2/05
Posts: 23069
I thought it was too early to say anything about portability between Unixes. It sounded like this was his first hands-on experience with Unix, so I asked what I hoped were easy questions that taught important concepts about pipes and filters. I thought that he ought to nail the basics down first.
6/14/11 2:45 PM
Ignore | Quote | Vote Down | Vote Up
notsodirty
1 The total sum of your votes up and votes down Send Private Message Add Comment To Profile

Member Since: 11/28/10
Posts: 458
cypherpunk - I thought it was too early to say anything about portability between Unixes. It sounded like this was his first hands-on experience with Unix, so I asked what I hoped were easy questions that taught important concepts about pipes and filters. I thought that he ought to nail the basics down first.
Yeah you're right, I tend to get a bit carried away with these things :-)
 

Reply Post

You must log in to post a reply. Click here to login.