`

shell报bash: service: command not found解决方法

阅读更多

今天在执行一个脚本时,本来是想在脚本中启动hdfs和hive等程序,可以在执行到service hive-server start等启动服务的命令时会报错,最终解决方法记录一下:

 

脚本报错如下:

./olap_quick_intall.sh: line 57: service: command not found

./olap_quick_intall.sh: line 59: jps: command not found

 

错误行代码:57行:service hive-server start

                      59行: jps

 

解决方法将service路径补全:/sbin/service hive-server start

                                                /data/jdk1.7.0_60/bin/jps                --这里根据实际jdk安装路径进行调整

 

 

 

分享到:
评论

相关推荐

    shell脚本执行jps时:-bash: jps: command not found

    我构建了hadoop集群。我们一定会写一个shell脚本去每一个节点上去jps,查看每个节点的进程情况。 原先以为shell很简单: #!/bin/bash #查看每个节点运行情况 for((host=101;...-bash: jps: command not found

    Linux -bash: ls: command not found

    今天登录阿里云后不知道怎么回事,一直报:-bash: ls: command not found 原因: 环境变量PATH被修改了 解决办法: 执行命令: export PATH=/bin:/usr/bin:$PATH 上边的方法执行完成,解决了问题,当关掉当前的...

    linux bash手册(英文,version 4.2)

    linux平台的bash shell开发帮助文档(手册),英文版,版本4.2。日常开发shell翻阅, 章节如下: Definitions:: Some definitions used i n the rest of this manual. Basic Shell Features:: The shell "building ...

    解决docker CMD/ENTRYPOINT执行sh脚本报: not found/run.sh:

    补充知识:docker中启动容器时CMD调用的sh脚本中if命令报未预期的符号 if[[的解决办法 最近通过Dockerfile编写镜像,CMD中调用的是sh脚本(start.sh)进行启动容器,通过docker run启动时,启动不成功,进行docker ...

    java调用shell脚本执行sqlldr与存储过程

    1、sqlldr: command not found 2、sqlplus: command not found 3、0750: You may need to set ORACLE_HOME to your Oracle software directory 4、Message 2100 not found; No message file for product=RDBMS, ...

    whatthecommit-cli:bash的whatthecommit-com命令行界面

    什么是承诺whatthecommit-cli或wtc从随机提交消息,并将其输出到终端用法$ wtcThat last commit message about silly mistakes pales in comparision to this one$$ wtc -hUsage: /path/to/wtc [commit]$ wtc commit...

    BASH Logger-开源

    这是Shell脚本的记录器。 此Shell脚本记录器具有以下功能-1>不同的日志级别。 2>不同级别的不同日志文件。 3>布局-易于理解

    bash-prompt-vcs:在bash提示中显示git,Mercurial(hg)和Subversion(svn)工作树的状态作为环境信息

    Bash提示版本控制状态 在bash提示中显示 , 和工作树的状态作为环境信息。 安装 将放在某个地方,然后在您的.bashrc添加: if [ -f /path/to/bash-prompt-vcs.bash ] ; then . /path/to/bash-prompt-vcs.bash fi ...

    pimp:简单的bash脚本来管理项目中的python-virtualenv

    拉皮条安装将此行添加到您的.bashrc文件中source /path/to/pimp.sh命令在里面pimp init启用从项目内部的任何路径激活virtualenv pimp activate跑步在virtualenv中运行python脚本,您不...壳启动python shell pimp shell

    config:配置文件

    各种配置文件要修复-bash: $'\r': command not found Cygwin中-bash: $'\r': command not found错误,将igncr添加到SHELLOPTS环境变量中。 在Windows上, setx SHELLOPTS "igncr"将设置变量。在Cygwin中将Git凭证...

    Swift提示:提示是命令提示符标记语言

    提示:如果收到类似“ bash: prompty: command not found ”之类的错误,则可能是因为您以非root用户身份(没有sudo )在本地安装了它。 很好,但是您需要从其本地路径调用Swift可执行文件: ~/.local/bin/prompty...

    2009 达内Unix学习笔记

    ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ 一、注意事项 命令和参数之间必需用空格隔开,参数和参数之间也必需用空格隔开。 一行不能超过256个字符;大小写有区分。 二、特殊字符含义 文件名以“.”开头...

    FTP-Bash-Backup:一个bash脚本,用于备份目录,然后将其上传到外部FTP服务器

    执行脚本时出现如下错误: ...$'\r': command not found... 此错误是由不正确的新行格式引起的。 可以通过安装dos2unix并在脚本上运行它来解决此问题,如下所示: dos2unix backupScript.bash 如何解密备份? 运行...

    git-ps1:一个简单的命令行提示符增强器,显示当前git repo(ps1)的状态

    git-ps1 一个简单的命令行提示符增强器,用于显示当前git repo(ps1)的状态。 如果您的git信息库的运行状况良好,则git-ps1只会向您显示当前分支。 如果运行状况不好,git-ps1也会显示 :thumbs_down...bash的例子 将

    shellpool:练习 Linux Shell

    贝壳池 练习 Linux Shell 脚本(这里只使用 #!/bin/bash) 笔记: #! -- sha-bang, a two-byte magic number, the command.../bin/env bash -- to avoid "Command not found" #!/bin/rm -- self-deleting script :P

    Linux下环境变量配置方法小结(.bash_profile和.bashrc的区别)

    在linux系统下,如果下载并安装了应用程序,在启动时很有可能在键入它的名称时出现”command not found”的提示内容。如果每次都到安装目标文件夹内,找到可执行文件 来进行操作就太繁琐了,这种情况下就涉及到环境...

    Small.Sharp.Software.Tools.epub

    You'll work with the Bash shell and the most common command-line utilities available on macOS, Windows 10, and many flavors of Linux. Create files without opening a text editor. Manage complex ...

    sysenv:就像用于系统软件包的virtualenv

    系统 就像用于系统软件包的virtualenv一样。 它会创建一个chroot ,它具有/sys , /dev , /proc和/home绑定挂载以及/usr , /bin等的overlayfs挂载。...Command not found $ cat hello.txt Hello world

    zshuery:[已弃用] 最小的 zsh 框架

    即插即用支持 Ubuntu 的 command-not-found、 、Debian/Ubuntu 上的 RubyGems、 、 提示设置别名(为了更好的可读性)和设置左右提示的“提示”命令 提示的内容: 信息、智能提示字符(由。± 当您在

Global site tag (gtag.js) - Google Analytics