Invitation to Authors

Interested in writing a book for us?


Please fill this form and get a chance to get published plus $200 bonus online coupon.


PayPal Logo
UNIX Shell Programming Interview Questions You\'ll Most Likely
UNIX Shell Programming Interview Questions You'll Most Likely

ISBN: 9781465798398

Price:   $19.95

Quantity :        
Book Description:

UNIX Shell Programming Interview Questions You'll Most Likely Be Asked is a perfect companion to stand ahead above the rest in today’s competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver's seat and helps them steer their way to impress the interviewer.

 

 

Table of Contents
1. C Shell - Beginner
2. C Shell - Intermediate
3. C Shell - Advanced
4. Bash - Beginner
5. Bash - Intermediate
6. Bash - Advanced
7. Basics
8. Commands
9. Variables and Arrays
10. Special Shell Variables
11. Operators and Shell Substitutions
HR Questions
INDEX
 
 
 

Includes:

 

a) 250 UNIX Shell Programming Interview Questions, Answers and Proven Strategies for getting hired as an IT professional

b) Dozens of examples to respond to interview questions

c) 51 HR Questions with Answers and Proven strategies to give specific, impressive, answers that help nail the interviews

d) 2 Aptitude Tests download available on www.vibrantpublishers.com

 

 

Sample from the book
(Below Questions and Answers are randomly taken from different pages of the book)
 

183: Name a limitation of getopts bash built-in.

Answer:

The getopts built-in does not support long option names with the double-dash prefix. It only supports single-character options.

 

184: Debug the following script excerpt:

number=1

 

while [ "$number" < 5 ]

do

echo -n "$number "

let "number += 1"

done

Answer:

Should be:

number=1

while [ "$number" -lt 5 ]

do

echo -n "$number "

let "number += 1"

done

 

185: Debug the following script excerpt:

function add_args ()

{

echo "Adding two numbers"

let "sumval = $1 + $2"

echo $sumval

}

 

num1=42

num2=11

echo "Sum of $num1 and $num2 = $(add2 $num1 $num2)"

Answer:

function add_args ()

{

# echo "Adding two numbers"

# The output of this function is captured, and the two echo

# commands concatenate.

let "sumval = $1 + $2"

echo $sumval

}

 

num1=42

num2=11

echo "Sum of $num1 and $num2 = $(add2 $num1 $num2)"

 

186: Write a script that replaces every occurrence of a pattern with another in a given file. The script receives 3 arguments: pattern_to_be_replaced substitution_pattern filename

Answer:

#!/bin/bash

 

if [ $# -ne 3 ]

then

echo "Usage: `basename $0` old-pattern new-pattern filename"

exit 70

fi

 

old_p=$1

subst_p=$2

 

if [ -f "$3" ]

then

filename=$3

else

echo "File "$3" does not exist."

exit 70

fi

 

sed -e "s/$old_p/$subst_p/g" $filename

 

187: Create a function that capitalizes the first character of its string arguments.

Answer:

capital_char ()

{

org_string="$@"

for str in $@

do

firstchar=${str:0:1}

rest_string=${str:1}

FirstChar=`echo "$firstchar" | tr a-z A-Z`

cap_string=${cap_string}" "$FirstChar$rest_string")

done

}

 

188: What does the following code snippet do?

declare -A files

find . -type f -exec sha1sum {} + | while read -r sum fname

do

if [[ ${files[$sum]} ]]

then

printf 'rm -- "%s" '

else

files[$sum]="$fname"

fi

done > duplics

Answer:

It checks for duplicate files using a hash table (associative array) indexed with the SHA sum of the files in the current directory. sha1sum computes and checks SHA1 message digest. It prints or checks SHA1 (160-bit) checksums.  This list passes through the while read loop to variables sum and fname. Then the script checks if there is already an element associated with the index $sum in the array files. If so, it is a duplicate file, and displays an "rm" message. Otherwise, the filename is added to the array files as a new element associated with the index $sum.

 

 

Share

New Title Idea Submission

Got a fantastic New Title Idea but didn't find it in our catalogue?


Please fill this form and see your idea getting published. Also a chance to win $100 coupon.



Visitor Rating : 10/ 10 Based on 590 ratings.