SHARE
TWEET
bash script in ubuntu 16
a guest
Nov 17th, 2016
108
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- ###This is a script (test.sh) that tries to include a file:
- #!/bin/bash
- #INCLUDE TARGETS
- . ~/config.conf
- ##
- ##This is what is in ~/config.conf, and notice that there is no shebang at the start of the file:
- ##
- USER1HOME="/home/user1"
- ECHO="/bin/echo"
- . ~/detect_os.fnc
- detect_os;
- ##
- ##This is what is in ~/detect_os.fnc
- ##
- detect_os() {
- UBUNTU_VER_DETECTED=`lsb_release -d`
- if [ "$UBUNTU_VER_DETECTED" == "Description: Ubuntu 16.04.1 LTS" ] ; then
- CHOWN="/bin/chown"
- ECHO="/bin/echo"
- GZIP="/bin/gzip"
- RM="/bin/rm"
- TAR="/bin/tar"
- TIME="/usr/bin/time"
- OS="Ubuntu"
- OS_VER="16"
- ${ECHO} ${USER1HOME}
- elif [ "$UBUNTU_VER_DETECTED" != "Description: Ubuntu 16.04.1 LTS" ] ; then
- exit 1
- fi
- }
RAW Paste Data
