Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: any examp. how check if alll.txt there after unzip  (Read 4676 times)

0 Members and 1 Guest are viewing this topic.

mishonok

  • Guest
any examp. how check if alll.txt there after unzip
« on: December 23, 2005, 09:00:19 AM »
Can anybody please give me some shell script example of how   ???  to make sure all 13 needed .txt are existed after unzipping the file.
THANK YOU !!  

ghostdog74



    Specialist

    Thanked: 27
    Re: any examp. how check if alll.txt there after u
    « Reply #1 on: December 23, 2005, 11:01:25 PM »
    not very sure what you actually want..

    #!/bin/sh
    numtest=13
    fullpath=/someunzipdir
    #....
    # doing unzip
    #....
    # check for unzip successful
    if [ $? -ne 0 ];then
           exit
    fi

    unzipnum=`ls -1 $fullpath/*.txt | wc -l`
    if [ $unzipnum -eq $num ]; then
           echo "all files there"
    fi

    mishonok

    • Guest
    Re: any examp. how check if alll.txt there after u
    « Reply #2 on: December 27, 2005, 05:06:14 PM »
    THANK YOU !!  ;D
    It may help ...
    I know that .zip file should have 13 .txt files, I need to have logic to be sure that all 13 files were sent
    (zipped )