Unix script help - HP UX

This is a discussion on Unix script help - HP UX ; Hello All, I like to create a unix script on HP UX 11i which does a move of a file if the file contains 'EOF' character at the end and has more than 1200 lines. Can someone help me create ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Unix script help

  1. Unix script help

    Hello All,

    I like to create a unix script on HP UX 11i which does a move of a
    file if the file contains 'EOF' character at the end and has more than
    1200 lines. Can someone help me create this shell script?


  2. Re: Unix script help

    jsubscribe@gmail.com wrote:
    > I like to create a unix script on HP UX 11i which does a move of a
    > file if the file contains 'EOF' character at the end and has more than
    > 1200 lines. Can someone help me create this shell script?


    CNT=$(wc -l < $TMP)
    tail -1 $TMP | grep -q "^EOF$"
    found=$?
    if [ $CNT -gt 1200 -a $found -eq 0 ]; then
    echo "found a file: $TMP"
    else
    echo "Not found"
    fi

    Change the first echo to your move. $TMP is the file.


+ Reply to Thread