In this i wont want to take the files on sat and sun (ie 0306 is june 3rd so every month i wont check the files on sat and sun which is in /venky directory)
can anybody know the solutions .........
Thanks in advance ........
---------- Post updated at 02:03 AM ---------- Previous update was at 02:00 AM ----------
HOW TO TAKE MISSING FILES...
Hi ,
Am using unix aix
I want to find the missing sequence no inside the files..
for ex ..
file mmm has following contents ..(files doesnt contains any character its have only the numbers)
1
3
4
5
8
--
---
I'm really not certain if this is what you're looking for, if it's not please provide a little more info:
#!/bin/sh
start_number=1
current_number=0
errfound=0
errfiles=""
for file in $(ls /venky); do
current_number="${start_number}"
file_error=0
while read line; do
if [ ! "${line}" = "${current_number}" ]; then
echo "Missing number: ${current_number}"
file_error=1
fi
done < $file
if [ "${file_error}" -ne 0 ]; then
errfiles="${errfiles}${file} "
fi
done
if [ ! -z "${errfiles}" ]; then
echo "The following files are missing numbers:"
echo "${errfiles}"
fi
exit 0
Thanks for reply ,
actually i didnt get the exact answers ..
take as examples ;
we have the file as tt.sh and contents as
4
5
7
8
14
...
..
i need the output like this ..(note file contents start line not be one it may be any value )
Missing number in the files are:-
6
9
10
11
12
13
.
.
.
thanks agama
its working fine ..but its taking the value from 1 ..
i dont want like that..
for ex:
first line in the file is 3
then
wants missing no after first line ..