Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash "set -e"

set -e causes the shell to exit if any subcommand or pipeline returns a non-zero status.

The answer the interviewer was probably looking for is:

It would be dangerous to use "set -e" when creating init.d scripts:

From http://www.debian.org/doc/debian-policy/ch-opersys.html 9.3.2 --

Be careful of using set -e in init.d scripts. Writing correct init.d scripts requires accepting various error exit statuses when daemons are already running or already stopped without aborting the init.d script, and common init.d function libraries are not safe to call with set -e in effect. For init.d scripts, it's often easier to not use set -e and instead check the result of each command separately.

This is a valid question from an interviewer standpoint because it gauges a candidates working knowledge of server-level scripting and automation
Comment

PREVIOUS NEXT
Code Example
Shell :: kubernetes command line to scale down pods 
Shell :: install eclipse in fedora 
Shell :: composer install linux 
Shell :: center table markdown github 
Shell :: pip install in jupyter notebook 
Shell :: git stash abort 
Shell :: chown specific user linux 
Shell :: how to install pip2 in kali linux 2021 
Shell :: kill a process with pid 
Shell :: linux external hard drive chmod 
Shell :: kubectl neat not found 
Shell :: how to remove your phone 
Shell :: clean local branches git 
Shell :: linux custom command 
Shell :: body-parser use 
Shell :: nuget commandline 
Shell :: print environment variables linux 
Shell :: reload ssh agent 
Shell :: git remove chached 
Shell :: yum install tesseract-ocr 
Shell :: conditional dockerfile 
Shell :: clear arp table ubuntu] 
Shell :: git remove all files in gitignore 
Shell :: mv all files in directory to parent 
Shell :: ubuntu install composer 
Shell :: apache start stop restart 
Shell :: windows show environment variables powershell 
Shell :: certbot configure 
Shell :: ubuntu use pip as pip3 
Shell :: how to delete file from git command 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =