Quantcast
Channel: What does 'set -e' mean in a Bash script? - Stack Overflow
Viewing all articles
Browse latest Browse all 12

What does 'set -e' mean in a Bash script?

$
0
0

I'm studying the content of this preinst file that the script executes before that package is unpacked from its Debian archive (.deb) file.

The script has the following code:

#!/bin/bashset -e# Automatically added by dh_installinitif [ "$1" = install ]; then   if [ -d /usr/share/MyApplicationName ]; then     echo "MyApplicationName is just installed"     return 1   fi   rm -Rf $HOME/.config/nautilus-actions/nautilus-actions.conf   rm -Rf $HOME/.local/share/file-manager/actions/*fi# End automatically added section

My first query is about the line:

set -e

I think that the rest of the script is pretty simple: It checks whether the Debian/Ubuntu package manager is executing an install operation. If it is, it checks whether my application has just been installed on the system. If it has, the script prints the message "MyApplicationName is just installed" and ends (return 1 mean that ends with an “error”, doesn’t it?).

If the user is asking the Debian/Ubuntu package system to install my package, the script also deletes two directories.

Is this right or am I missing something?


Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>