无法在终端上运行Shell脚本

时间:2018-09-02 21:47:04

标签: bash shell terminal

以前,我可以通过以下方式在终端中运行shell脚本:

sudo chmod a+x /path/to/script

运行方式

/path/to/script/./scriptToRun.sh

这是输出:        文件:dir,节点:顶部这是INFO树的顶部

  This (the Directory node) gives a menu of major topics.
  Typing "q" exits, "?" lists all Info commands, "d" returns here,
  "h" gives a primer for first-timers,
  "mEmacs<Return>" visits the Emacs manual, etc.

  In Emacs, you can click mouse button 2 on a menu item or cross reference
  to select it.

* Menu:

Texinfo documentation system
* Info: (info).                 How to use the documentation browsing system.
* Texinfo: (texinfo).           The GNU documentation format.
* info stand-alone: (info-stnd).           Read Info documents without Emacs.
* infokey: (info-stnd)In

现在它打开了emacs,我似乎无法再运行脚本了。

文件中的字母为#!/bin/bash -e

如果有人对此进行了修复,将不胜感激。

1 个答案:

答案 0 :(得分:0)

尝试一下

$ cd /path/to/script && ./myscript.sh

如果不起作用,请以超级用户身份运行此命令