The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
Without knowing what your problem is I would improve the script this way:
#!/usr/bin/sh
# Script to count number of lines from the ls - l command
# Start by copying the old countfile to a new one that will be referenced later
mv /usr/byr/countfile /usr/byr/countfile2
# then pipe the output of the counting of the lines to the countfile
ls -l /usr/byr/ | wc -l | read new
echo $new > /usr/byr/countfile
# assign the variable $new to the current number of lines
# and assign $old to the previous number of lines
cat /usr/byr/countfile2 | read old
echo $new
echo $old
# then compare the value of the old number to the new number
# and write to the testfile a string that will be looked at by NIGHTWATCH
if [ $new -gt $old ]; then
echo ok > /usr/byr/testfile
echo $new
echo $old
echo "ok"
elif [ $new -eq $old ]; then
echo same > /usr/byr/testfile
echo $new
echo $old
echo "same"
else
echo fail > /usr/byr/testfile
echo $new
echo $old
echo "fail"
fi
======
Werner