Lab #12

Last modified:  Thu Oct 12 16:51:16 EDT 2017

Files

Part C Code Examples

To (re)create the wastebasket:

mkdir -p "${RecycleBin}"

To initialize the variable to remember the -c switch:

clear_mode=0

The case for the -c switch:

	-c)	clear_mode=1
		;;

To clear the wastebasket:

if [ $clear_mode -eq 1 ]
then
	echo Empty wastebasket
	if [ $interactive_mode -eq 1 ]
	then
		echo rm -r -i -- "${RecycleBin}"
	else
		echo rm -r -i -f -- "${RecycleBin}"
	fi
	exit 0
fi

Download an example of using version numbers.  To run it, use:

touch x ; ./delver x ; ls -l ~/.recycled

Links

Back to CTEC1863