#!/bin/bash # exit when any command fails set -e # keep track of the last executed command trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG # echo an error message before exiting trap 'echo "\"${last_command}\" command filed with exit code $?."' EXIT [ ! -d "/tmp/install" ] && mkdir /tmp/install cd /tmp/install wget https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.16.958-amd64.deb gdebi shiny-server-1.5.16.958-amd64.deb