#!/bin/sh # opsetup.sh: Shell script to setup the OPS/MVS command processors in USS. installTo=/usr/local/bin # Customize! (your install target directory) modules='oi opsimex ox opsdynam opsgetv opsgetvl opssetv opsdelv opsql oprxdy' if [ ! -d $installTo ]; then # See if destination directory exists mkdir $installTo # No, create destination directory if [ $? -ne 0 ]; then # Did mkdir work? Error msg & die if not echo "mkdir $installTo failed" exit 1 fi echo "You should add $installTo to your PATH" fi cd $installTo # Change to destination directory if [ $? -ne 0 ]; then # Did cd work? Error msg & die if not echo "Unable to change to directory $installTo" exit 1 fi rm -f $modules # Remove any existing matching files if [ $? -ne 0 ]; then # Did it work? Error msg & die if not echo "Unable to delete existing files from directory $installTo" exit 1 fi touch $modules # Create null (0 length) files if [ $? -ne 0 ]; then # Did it work? Error msg & die if not echo "Unable to create null files in directory $installTo" exit 1 fi chmod a=rx,o+s $modules # Set read+execute permission, sticky bit if [ $? -ne 0 ]; then # Did it work? Error msg & die if not echo "Unable to set permissions for null files in directory $installTo" exit 1 fi echo "The following files were installed:" ls -E $modules # List installed files showing sticky bit