Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Exclamation Bash shell script error

    Hello all,

    I am new to linux bash shell scripting.

    I am trying to execute the following script on my linux box, but getting error.

    Can anyone please help me to get out of it....?

    Functionality : I have one search tool CCSearchX, whenever I execute the toll it generates some files. So here here first I am checking whether the same process is in execution or not, if yes then do nothing and if no then check whether any previous result file is available or not. if result file is available then do nothing and if result file is not available execute the CCSearchX utility.

    following is the shell script

    pgrep -f "CCSearchX"
    if [ $status != 0 -a $status != 1 -a $status != "" ];
    echo "Process is running"
    cd /tmp
    if [ "$(find -name 'linux_result_cc_search_*')" != "" ];
    echo "Output file linux_result_cc_search_* exist."
    ./CCSearchX --input=/ --output=/tmp/linux_result_cc_search_1287659590.txt

    And I am getting following error line 16: syntax error: unexpected end of file
    Last edited by ecomwebtester; 10-21-2010 at 11:51 AM. Reason: forgot to add some code #!/bin/bash

  2. #2
    Linux Newbie
    Join Date
    Apr 2010
    Novosibirsk, Russia
    I suppose it fails because of wrong usage of nested if-else-if. Try this Nested if/then Condition Tests

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts