Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unix 找不到文件错误消息_Unix_Cygwin_File Not Found - Fatal编程技术网

Unix 找不到文件错误消息

Unix 找不到文件错误消息,unix,cygwin,file-not-found,Unix,Cygwin,File Not Found,我正在使用cygwin为一个从internet下载的项目运行.sh文件。 我有一个配置文件,在其中输入配置: sh C:/Newfolder/project/filename.sh 我得到的信息是: “C:/Newfolder/project/configure:第83行::config:未找到文件”。 configure包含以下说明: #!/bin/bash check_or_create_dir() { if [[ ! -d "${!1}" ]]; then if [[ -e "${

我正在使用cygwin为一个从internet下载的项目运行.sh文件。 我有一个配置文件,在其中输入配置: sh C:/Newfolder/project/filename.sh 我得到的信息是: “C:/Newfolder/project/configure:第83行::config:未找到文件”。 configure包含以下说明:

#!/bin/bash
check_or_create_dir()
{
  if [[ ! -d "${!1}" ]]; then
  if [[ -e "${!1}" ]]; then
    echo "Error: $1 should be a directory. Check your config"
    exit 1
  else
    mkdir "${!1}"
    if [[ $? -ne 0 ]]; then
      echo "Error: $1 doesn't exist and cannot be created. Check your config"
      exit 1
    fi
  fi
fi
}

check_file()
{
    if [[ ! -f $1 ]]; then
        echo "Error: missing file $1. Check your config"
        exit 1
    fi
}

check_var()
{
    if [[ -z ${!1} ]];
    then
        echo "Error: $1 not set in config. Check your config"
        exit 1
    fi

    export $1
}

check_exe()
{
    if (which "$1" >& /dev/null); then
        return 0
    else
        echo "Error: missing required program: $1"
        exit 1
    fi
}

if [[ -e config ]];
then
    . config
else
    echo "Error: no config file in current directory"
    exit 0
fi

check_var "DECKARD_DIR"
check_var "FILE_PATTERN"
check_var "SRC_DIR"

check_var "VECTOR_DIR"
check_or_create_dir "VECTOR_DIR"
check_var "CLUSTER_DIR"
check_or_create_dir "CLUSTER_DIR"
check_var "TIME_DIR"
check_or_create_dir "TIME_DIR"

check_var "VGEN_EXEC"
check_file "$VGEN_EXEC"
check_var "GROUPING_EXEC"
check_file "$GROUPING_EXEC"
check_var "CLUSTER_EXEC"
check_file "$CLUSTER_EXEC"
check_var "POSTPRO_EXEC"
check_file "$POSTPRO_EXEC"

check_var "MIN_TOKENS"
check_var "STRIDE"
#check_var "DISTANCE"
check_var "SIMILARITY"
check_var "GROUPING_S"
#check_var "GROUPING_D"
#check_var "GROUPING_C"

check_exe "which"
check_exe "env"
check_exe "python"
check_exe "awk"
check_exe "sed"
check_exe "grep"
check_exe "find"
check_exe "bash"
check_exe "cat"
check_exe "touch"
check_exe "head"
check_exe "tail"
#check_exe "time"

# For parallel processing
if [[ -z "${MAX_PROCS}" ]];
then
   echo "Warning: MAX_PROCS not set in config. Assume 0"
   MAX_PROCS=0
fi
export MAX_PROCS

错误消息行号不与任何对文件
config
的引用“对齐”。在测试时,您是否在编辑代码(移动内容)?您是否将代码粘贴到了?(看起来还可以,但我不能花时间看100行的脚本)。祝你好运尝试在目录中运行
cd/cygdrive/c/Newfolder/project/
/filename.sh
我的代码是:if[-e config]];那么。config else echo“Error:no config file in current directory”退出0,而我收到的错误消息是:configure:line 83::config:file not found line 83 corresponds to.config可能需要
。配置
?或
。在代码中配置
?在任何一种情况下,错误消息都不会对您撒谎,您需要找出@matzeri的评论,您是否使用
cd/path/to/cfgDir
和/或
/path/to/cfgDir/config
。祝你好运。错误消息行号与文件
config
的任何引用都不“对齐”。在测试时,您是否在编辑代码(移动内容)?您是否将代码粘贴到了?(看起来还可以,但我不能花时间看100行的脚本)。祝你好运尝试在目录中运行
cd/cygdrive/c/Newfolder/project/
/filename.sh
我的代码是:if[-e config]];那么。config else echo“Error:no config file in current directory”退出0,而我收到的错误消息是:configure:line 83::config:file not found line 83 corresponds to.config可能需要
。配置
?或
。在代码中配置
?在任何一种情况下,错误消息都不会对您撒谎,您需要找出@matzeri的评论,您是否使用
cd/path/to/cfgDir
和/或
/path/to/cfgDir/config
。祝你好运