Bourne shell Developer Hiring Guide

Hiring Guide for Bourne shell Engineers

Ask the right questions to secure the right Bourne shell talent among an increasingly shrinking pool of talent.

The Bourne shell, also known as "sh", is a computer programming language developed by Stephen Bourne at AT&T's Bell Labs in 1979. It is a command processor typically run in a text window, allowing the user to type commands that cause actions. The Bourne shell was the first major Unix shell and introduced several programming features, including control flow and variables. It served as the standard Unix command line interpreter until it was largely superseded by Bash in 1989. This information can be verified from various sources including "A Quarter Century of UNIX" by Peter H. Salus and the official Bell Labs website.

First 20 minutes

General Bourne shell knowledge and experience

The next 20 minutes of the interview should attempt to focus more specifically on the development questions used, and the level of depth and skill the engineer possesses.

What are the different types of variables in Bourne Shell?

In Bourne Shell, there are two types of variables: System variables and User-defined variables. System variables are created and maintained by the system, while User-defined variables are created and maintained by the user.

How would you execute a shell script in Bourne Shell?

A shell script can be executed by typing 'sh scriptname.sh' in the terminal. Alternatively, you can make the script executable using 'chmod +x scriptname.sh' and then run it using './scriptname.sh'.

Describe the difference between 'echo' and 'printf' in Bourne Shell.

'echo' is a shell command that outputs its arguments followed by a newline. 'printf', on the other hand, is more sophisticated where you can format the output using format specifiers, similar to 'printf' in C language.

What are positional parameters in Bourne Shell?

Positional parameters are a series of special variables ($0 through $9) that contain the contents of the command line.

How would you define a variable in Bourne Shell?

In Bourne Shell, a variable can be defined using the syntax 'variable_name=value'. For example, 'x=10' defines a variable 'x' with value '10'. There should be no space around the '=' sign.

The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

What youre looking for early-on

Does the candidate have a good understanding of software development methodologies?

This is important for ensuring that the candidate can work effectively within the team's established development process.

Has the candidate shown knowledge of other scripting languages like Python, Perl, or Ruby?

Knowledge of other scripting languages can be beneficial for integrating Bourne shell scripts with other systems or scripts.

Has the candidate displayed good communication skills?

Good communication skills are vital in a team-based work environment to ensure smooth collaboration.

Has the candidate shown experience with Unix/Linux environments?

Experience with Unix/Linux environments is crucial as Bourne shell is a Unix shell and command-line interpreter.

Did the candidate demonstrate problem-solving skills during the interview?

This is important as developers often need to find solutions to complex problems.

Does the candidate have a strong understanding of Bourne shell scripting?

This is necessary because Bourne shell scripting is the core competency required for the position.

Next 20 minutes

Specific Bourne shell development questions

The next 20 minutes of the interview should attempt to focus more specifically on the development questions used, and the level of depth and skill the engineer possesses.

How would you handle errors in Bourne Shell?

Error handling in Bourne Shell can be done using 'trap' command. It allows you to catch signals and execute a command to handle the situation.

Describe the difference between 'test' and '[ ]' in Bourne Shell.

In Bourne Shell, 'test' and '[ ]' are used for conditional testing. They are almost equivalent, but '[ ]' requires a space at both ends.

What are the different types of loops in Bourne Shell?

Bourne Shell supports three types of loops: for loop, while loop, and until loop.

How would you read input from the user in Bourne Shell?

Bourne Shell provides the 'read' command to read input from the user. For example, 'read name' will prompt the user to enter a value, which will then be assigned to the variable 'name'.

Describe the difference between single and double quotes in Bourne Shell.

In Bourne Shell, single quotes preserve the literal value of all characters within the quotes, while double quotes preserve the literal value of all characters within the quotes, with the exception of '$', '`', '\', and '"', when preceded by the '$' sign.

The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

The ideal back-end app developer

What you’re looking to see on the Bourne shell engineer at this point.

At this point, a skilled Bourne shell engineer should demonstrate proficiency in shell scripting, deep understanding of Unix/Linux systems, and problem-solving abilities. Red flags include lack of knowledge about standard utilities and commands or inability to debug a basic script.

Digging deeper

Code questions

These will help you see the candidate's real-world development capabilities with Bourne shell.

What does the following Bourne shell code do?

#!/bin/sh

if [ -d "$1" ]; then
  echo "Directory exists!"
else
  echo "Directory does not exist!"
fi

This script checks if a directory exists. If the directory exists, it prints 'Directory exists!', otherwise it prints 'Directory does not exist!'. The directory to check is provided as the first command line argument.

What will be the output of the following Bourne shell code?

#!/bin/sh

var1="Hello"
var2="World"

echo "$var1 $var2"

The output of this script will be 'Hello World'. It concatenates two variables with a space in between and prints them.

What does the following Bourne shell code do?

#!/bin/sh

arr=(1 2 3 4 5)

for i in "${arr[@]}"
do
  echo $i
done

This script prints all the elements of an array, one per line. The array contains the numbers 1 to 5.

What does the following Bourne shell code do?

#!/bin/sh

count_to_100 () {
  for i in {1..100}; do
    echo $i
  done
}

count_to_100 &

wait

This script defines a function that counts from 1 to 100, each number on a new line. It then runs this function in the background, and waits for it to finish before the script itself finishes.

What does the following Bourne shell code do?

#!/bin/sh

classname=$1

if [ -z "$classname" ]; then
  echo "No class name provided."
  exit 1
fi

classfile="$classname.sh"

echo "Creating class file $classfile..."

echo "#!/bin/sh" > $classfile

echo "echo 'This is class $classname.'" >> $classfile

chmod +x $classfile

This script creates a new Bourne shell script file with a name provided as the first command line argument. The new script, when run, will print 'This is class ', followed by its own name.

What will be the output of the following Bourne shell code?

#!/bin/sh

func () {
  local var="local variable"
  echo $var
}

var="global variable"

func

echo $var

The output of this script will be 'local variable' followed by 'global variable'. It defines a function that declares a local variable and prints it, then declares a global variable with the same name, calls the function, and prints the global variable.

Wrap-up questions

Final candidate for Bourne shell role questions

The final few interview questions for a Bourne shell candidate should typically focus on a combination of technical skills, personal goals, growth potential, team dynamics, and company culture.

Describe the difference between a shell variable and an environment variable in Bourne Shell.

A shell variable is a variable that is defined in shell and is only available to the current shell. An environment variable, on the other hand, is available system wide and can be accessed by any sub-shell or process.

What are the different types of substitution in Bourne Shell?

Bourne Shell supports several types of substitutions, including: Command substitution, Variable substitution, Arithmetic substitution, and Process substitution.

How would you debug a shell script in Bourne Shell?

You can debug a shell script in Bourne Shell by using the '-x' option with the shell command. For example, 'sh -x scriptname.sh'. This will print each command to the standard error output before executing it.

Describe the difference between '&&' and '||' in Bourne Shell.

In Bourne Shell, '&&' is a logical AND operator that performs command chaining, meaning the second command is executed only if the first command succeeds. '||', on the other hand, is a logical OR operator where the second command is executed only if the first command fails.

What are the different types of parameter expansions in Bourne Shell?

Bourne Shell supports several types of parameter expansions, including: String length, Substring, Indirect variable reference, Default value, and Assignment with default value.

The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

Bourne shell application related

Product Perfect's Bourne shell development capabilities

Beyond hiring for your Bourne shell engineering team, you may be in the market for additional help. Product Perfect provides seasoned expertise in Bourne shell projects, and can engage in multiple capacities.