I am trying to write a unix script that will compare source directories. first I create three files using the ls -la for each source directory. then I want to sepearate the directory names to a file and the files to a file.
then I want to compare the directory files. and then compare the file files.
This is what I have so far. I do not know how to write a loop.
#!/bin/sh
#
#
###############################################################
echo "Starting Compare Process"
###############################################################
testsrc=/src/testsrc
devsrc=/src/devsrc
prodsrc=/src/prodsrc
tmpdir=/src/tmp
rm $tmpdir/testlist1.lst
rm $tmpdir/prodlist1.lst
rm $tmpdir/devlist1.lst
cd $testsrc
ls -la > $tmpdir/testlist1.lst
echo 'created testlist1'
cd $devsrc
ls -la > $tmpdir/devlist1.lst
echo 'created devlist1'
cd $prodsrc
ls -la > $tmpdir/prodlist1.lst
echo 'created prodlist1'
Please help!!!
then I want to compare the directory files. and then compare the file files.
This is what I have so far. I do not know how to write a loop.
#!/bin/sh
#
#
###############################################################
echo "Starting Compare Process"
###############################################################
testsrc=/src/testsrc
devsrc=/src/devsrc
prodsrc=/src/prodsrc
tmpdir=/src/tmp
rm $tmpdir/testlist1.lst
rm $tmpdir/prodlist1.lst
rm $tmpdir/devlist1.lst
cd $testsrc
ls -la > $tmpdir/testlist1.lst
echo 'created testlist1'
cd $devsrc
ls -la > $tmpdir/devlist1.lst
echo 'created devlist1'
cd $prodsrc
ls -la > $tmpdir/prodlist1.lst
echo 'created prodlist1'
Please help!!!