Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi
i have different versions like v1.0.0.0,v1.0.2.0 and etc in each version i have a file called checksum.csv.
in checksum.csv i have different scriptsi want to compare these .csv file with each version.
if i get any new script in the.csv file of the version i have to display the name of the script and version of that and these should be sent to a log file.can u help me in this issue
thanks in advance

Hi
i have different directoris like v1.0.0.0,v1.0.2.0.....V1.0.7.0 in each directory i have a file called checksum.csv.
in checksum.csv i have many scripts like procStartAcq.ksh,Proctitu.ksh etcFor every directorty i have one checksum.csv file
i want to compare these .csv file with each directory V1.0.0.0.
if i get any new script in the.csv file of the version i have to display the name of the script and version of that and these should be sent to a log file.

I'm still not sure of your spec, but I check each checksum..csv file against v1.0.0.0/checksum.csv.
assumed each of your scripts were more than one to a line separated by commas.
Also, assumed all directories were on one level and the script either exists at that level or you place a cd command.
Let me know if you have any questions.
!/bin/ksh# cd <to mydir location>
dd=$(pwd)
cfile="${dd}/v1.0.0.0/checksum.csv.tmp"
cd "./v1.0.0.0"
sed 's/,/ /g' checksum.csv|xargs -n1 > checksum.csv.tmp
cd ..
rm -f /tmp/logfile.txtfind . -type d -name "v1.0.*" -print|while read mydir
do
if [[ "$mydir" == "./v1.0.0.0" ]]
then
continue
ficd "$mydir"
rm -f checksum.csv.tmp
# place all the scripts on one line
sed 's/,/ /g' checksum.csv|xargs -n1 > checksum.csv.tmp
while read line
do
cnt=1
while read myscript
do
if [[ "$line" = "$myscript" ]]
then
cnt=0
break
fi
done < "$cfile"if [[ cnt -eq 1 ]]
then # send it to file if script not found
echo "${mydir}:${line}" >> /tmp/logfile.txt
fi
done < checksum.csv.tmp
cd ..
done

![]() |
Need help in XIPT003I
|
how to read a file
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |