Shell script testing

Some time ago I had to test several shell scripts how they affect the running environment on Linux.

I ended up writing this simple script to help testing. This example script runs script, and shows changes to enviroment variables the script causes.

# Script to handle file sending to server
env > env.1
set > set.1
source ""
env > env.2
set > set.2
echo "Environment:"
sdiff -s env.1 env.2 |cut -d">" -f2
echo "Variables:"
sdiff -s set.1 set.2 |cut -d">" -f2
rm set.1 set.2 env.1 env.2


Be the first to post a comment.

Leave a Comment

Your email address will not be published. Required fields are marked *