zoukankan      html  css  js  c++  java
  • linux 环境下bash脚本中找不到命令

    mr.sh: line 1: HADOOP_CMD: command not found
    mr.sh: line 4: INPUT_FILE_PATH: command not found
    mr.sh: line 6: OUTPUT_PATH: command not found
    mr.sh: line 8: fs: command not found
    Illegal option: /
    Usage: jar {ctxui}[vfmn0PMe] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
    Options:
        -c  create new archive
        -t  list table of contents for archive
        -x  extract named (or all) files from archiv
    

    进行在分布式集群上跑MapReduce的时候,通过脚本来运行,发现提示找不到相应的命令。

    HADOOP_CMD = "/usr/local/src/hadoop-2.6.5/bin/hadoop"
    STREAMING_JAR_PATH = "/usr/local/src/hadoop-2.6.5/share/hadoop/tools/lib/hadoop-streaming-2.6.5.jar"
    
    INPUT_FILE_PATH = "/data/The_Man_of_Property.txt"
    
    OUTPUT_PATH = "/OUTPUT/wc"
    

    错误的原因就是一条命令不要有空格,在等于号两边不要有空格,不要有空格,不要有空格。

    有空格就会报错。

  • 相关阅读:
    case 条件语句
    shell 函数
    if条件语句
    IP地址分类和分段
    shell脚本的条件测试与比较
    bc命令
    [LeetCode]Remove Duplicates from Sorted Array II
    [LeetCode]Merge Two Sorted Lists
    [LeetCode]Climbing Stairs
    [LeetCode]Merge Intervals
  • 原文地址:https://www.cnblogs.com/hanwen1014/p/10987809.html
Copyright © 2011-2022 走看看