原文:将window的shell脚本通过ftp传输到Linux服务器后, shell脚本中执行时提示“没有那个文件或目录”的解决办法

出现bad interpreter:No such file or directory的原因,是文件格式的问题。这个文件是在Windows下编写的。换行的方式与Unix不一样,但是在vim下面如果不Set一下又完全看不出来。问题分析: 将windows 下编写好的SHELL文件,传到linux下执行,提示出错。 出错信息:bad interpreter: 没有那个文件或目录。 问题原因:因为操作系 ...

2017-12-21 09:58 0 1538 推荐指数:

查看详情

shell脚本执行source命令不生效的解决办法

一个shell脚本文件中有一个source命令,使用bash a.sh命令执行source命令进行验证没有生效。 这是因为在shell脚本执行source会看到效果,但是shell脚本执行再次验证就没看到效果。 此时可以换这种方式执行shell脚本命令:source a.sh ...

Tue Apr 13 21:23:00 CST 2021 0 1105
java远程执行linux服务器上的shell脚本

业务场景:需要从服务器A中新增的文件同步至本地服务器服务器A内存有限,需同步成功之后清除文件。 Java调用远程shell脚本,需要和远程服务器建立ssh链接,再调用指定的shell脚本。 1.创建清除文件shell脚本,可以使用touch或者vi命令 ...

Sat Apr 11 02:12:00 CST 2020 1 3250
linux检测服务器服务与端口的shell脚本

https://yq.aliyun.com/ziliao/106027 https://yq.aliyun.com/ziliao/65927?spm=a2c4e.11155472.blogcont.23.7fe76988W6oBo9 linux检测服务器服务与端口的shell脚本 ...

Tue Mar 27 17:38:00 CST 2018 0 3770
执行shell脚本提示bad interpreter:No such file or directory的解决办法

故障现象:在终端直接cd /var正常,在shell脚本执行则报错。原因是脚本是在windows平台下写的,换行符与 Linux不同,造成脚本不能正确执行 出现bad interpreter:No such file or directory(没有那个文件目录)的原因,是文件 ...

Sat Jul 01 21:51:00 CST 2017 0 16837
Linux运行shell脚本提示No such file or directory错误的解决办法

Linux执行.sh文件提示No such file or directory的问题: 原因:在windows写好shell脚本测试正常,但是上传到 Linux 上以脚本方式运行命令时提示No such file or directory错误,那么一般是文件格式是dos格式的缘故,改成 ...

Sat Sep 21 07:43:00 CST 2019 0 3245
在远程服务器执行本地的shell脚本

在远程服务器执行本地的shell脚本 [root@localhost zzx]# sh echoip.sh 192.168.67.131[root@localhost zzx]# ssh root@192.168.67.129 -C "/bin/bash" < ...

Mon Sep 25 06:13:00 CST 2017 0 1658
在PHP调用php_ssh实现远程登陆linux服务器执行shell脚本

这个功能主要用于在web端利用程序对远程服务器进行操作,通过PHP_ssh执行shell脚本来实现。 首先要安装php_ssh2组件,linuxcentos7下有ssh2源,直接安装。window下则需要自行下载dll组件加载,具体方法自行搜索。 安装完毕就可以在PHP写执行 ...

Tue May 16 03:53:00 CST 2017 0 2749
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM