【玩转Ubuntu】08. Linux报错:Syntax error: "(" unexpected解决办法
问题:
在MAC上写了一段shell脚本,放到Ubuntu上运行总是报下面这个错误,单步调试都是对的,就是直接运行会报错。
bixiaopeng@ubuntu:~/package$ sh package.sh
package.sh: 8: package.sh: Syntax error: "(" unexpected
原因:
兼容性问题,因为linux将sh默认指向了dash,而不是bash
解决:
#在root下面执行 dpkg-reconfigure dash,选择no
bixiaopeng@ubuntu:~/package$ su
Password:
root@ubuntu:/home/bixiaopeng/package# dpkg-reconfigure dash
再次执行脚本就OK了
【玩转Ubuntu】08. Linux报错:Syntax error: "(" unexpected解决办法的更多相关文章
- Linux下docker报错syntax error:unexpected protocol at end of statement
---恢复内容开始--- [Linux]Shell脚本“syntax error: unexpected end of file”原因及处理 :::https://blog.csdn.net/u013 ...
- php Yii2使用registerJs或registerCss报错syntax error, unexpected end of file
解决方法: 注册时$js=<<<JS .....JS;//结尾处JS;应单独成行并且没有空格 JS;//这样就会报错,多了空格JS;//这样就不会
- cooking构建工具报错MSBUILD :error MSB4132解决办法
最近学习cooking构建工具的时候,在自己的笔记本上运行的好好的,项目在公司电脑上clone下来的时候,发现构建报错,逐条查错,试了好多方法也不行 最后在github上找到了答案,只是之前一直没找到 ...
- php报错syntax error, unexpected T_GOTO, expecting T_STRING,报错文件与行数指向以下代码,是什么原因?
本机php版本是5.3.8,Apache/2.2.21public function goto($url, $msg=NULL) {if ($msg) {$this->jsAlert($msg) ...
- 关于报错“syntax error near unexpected token `”和回车换行
本来是很简单一个事情,转过来是因为打字机这事比较有趣…… http://blog.csdn.net/xyp84/archive/2009/08/11/4435899.aspx 摘要一下: 回车 换行 ...
- JS function document.onclick(){}报错Syntax error on token "function", delete this token
JS function document.onclick(){}报错Syntax error on token "function", delete this token func ...
- 一个参数大小写引发的uploadify报错 "Syntax error, unrecognized expression: #"
上传控件uploadify 报错"Syntax error, unrecognized expression: #" 版本为 uploadify3.2 报错原因:参数ID[hi ...
- JS function document.onclick(){}报错Syntax error on token "function", delete this token - CSDN博客
原文:JS function document.onclick(){}报错Syntax error on token "function", delete this token - ...
- linux shell 报错 Syntax error: Bad for loop variable
在linux下写了一个简单的shell,循环10次. test.sh #!/bin/bash ## ##循环10次 ## ; i<; i++)); do echo Good Morning ,t ...
随机推荐
- 1、 Linux中的root用户切换(转载)
su和su - 的区别 大部分Linux发行版的默认账户是普通用户,而更改系统文件或者执行某些命令,需要root身份才能进行,这就需要从当前用户切换到root用户,Linux中切换用户的命令是su或s ...
- mac os vim 乱码
yum -y groupinstall chinese-support vim /etc/sysconfig/i18n LANG="zh_CN.UTF-8" LANGUAGE=&q ...
- Jexus下配置多个站点
一.在jexus中一个配置文件就是一个站点,有多少个配置文件就可以创建多少个站点 配置文件所在的位置 在siteconf中有一个最基本的配置 default ##################### ...
- 数字时钟DigClock
首先建立数字显示类: using System; using System.Drawing; namespace CsDev { class SevenSegmentDispay { Graphics ...
- Python进阶之自定义排序函数sorted()
sorted() .note-content {font-family: "Helvetica Neue",Arial,"Hiragino Sans GB",& ...
- 精读《javascript高级程序设计》笔记二——变量、作用域、内存以及引用类型
变量.作用域和内存问题 执行环境共有两种类型——全局和局部 作用域链会加长,有两种情况:try-catch语句的catch块,with语句. javascript没有块级作用域,即在if,for循环中 ...
- 纯css3实现tab选项卡
<!doctype html> <html> <head> <title>Welcome</title> <meta http-equ ...
- 软件测试学习日志————round 1 some questions of two small programs
Below are four faulty programs. Each includes a test case that results in failure. Answer the follow ...
- 【Chromium中文文档】多进程资源加载
多进程资源加载(需要更新) 转载请注明出处:https://ahangchen.gitbooks.io/chromium_doc_zh/content/zh//General_Architecture ...
- billing是如何的拆分的?
在SD模块中,我们经常会考虑Billing分拆,分拆的标准如下: 一.根据Billing的字段项目进行分拆 在sap的标准系统中,系统会比较VBRK表的所有字段(也包含复制拆分组合标准字段ZUKRI) ...