首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Server中执行bash脚本

在Server中执行bash脚本
EN

Stack Overflow用户
提问于 2018-09-22 06:53:10
回答 1查看 2.3K关注 0票数 1

我已经为bash编写了一个脚本,并在Windows 10上安装了bash,所以当尝试在命令提示符中运行该脚本时,请编写以下语法:

代码语言:javascript
复制
bash -c "/home/behzad/SIP-CMD-BYE_OLT-CMD-ACT.sh 09400098129 1234 8 2
 1 1 99 3 2001"

一切都很好!现在,我想在Server中运行该脚本,为此目的,在Server中编写这个T:

代码语言:javascript
复制
EXEC master..xp_CMDShell 'bash -c "/home/behzad/SIP-CMD-BYE_OLT-CMD-ACT.sh 09400098129 1234 8 2 1 1 99 3 2001"'

但是Server只显示字符结果W和bash脚本不起作用。我怎样才能解决这个问题?谢谢大家。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-22 09:37:02

试试这个:

代码语言:javascript
复制
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52454275

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档