Linux下shell指令碼報錯 [: test: unexpected operator
最近編譯 ssd的create_list.sh指令碼遇到 [: test: unexpected operator的問題,
後來發現是由於 []等問題引起的,查閱資料發現是 Linux預設sh連結到dash的,和bash不相容,
dash應該也是和bash相似的一種shell指令碼
解決方法:
sudo dpkg-reconfigure dash
選擇否/No 就可以了
相關推薦
Linux下shell指令碼報錯 [: test: unexpected operator
最近編譯 ssd的create_list.sh指令碼遇到 [: test: unexpected operator的問題, 後來發現是由於 []等問題引起的,查閱資料發現是 Linux預設sh連結到dash的,和bash不相容, dash應該也是和bash相似的一種shell指令碼
Linux下編譯ffmpeg報錯gcc is unable to create an executable file C compiler test failed.
程式碼報錯資訊: [[email protected] ffmpeg-3.2.2]# ./configure --enable-shared --prefix=/usr/local/ffmpeg gcc is unable to create an executable
解決 linux下編譯.sh檔案報錯 “[: XXXX: unexpected operator” 問題
原因:linux下能正常執行的指令碼,在ubuntu系統中都會編譯報錯,因為二者使用的直譯器不一同導致 Linux:.sh ubuntu:.dash 因為ubuntu預設的sh是連線到dash的,又因為dash跟bash的不相容所以出錯了.執行時可以把sh換成bash檔
FFMPEG系列三:linux下編譯ffmpeg報錯gcc is unable to create an executable file C compiler test failed.
linux編譯ffmpeg過程報錯gcc is unable to create an executable file C compiler test failed.網上找了一圈,關於這個問題的答
Linux下關閉tomcat報錯java.net.ConnectException: Connection refused
Linux下關閉tomcat報錯,具體如下: Using CATALINA_BASE: /home/alpha/apache-tomcat-7.0.62 Using CATALINA_HOME: /home/alpha/apache-tomcat-7.0.62 Using CATALIN
linux下string型別報錯
提示:string 不是一個型別名 #include <iostream> #include <string> 
linux下mysql安裝報錯及修改密碼登入等等
1:下載 [root@localhost soft]# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz 2:解壓檔案 [root@dbserver /]# tar -xzvf
linux下teamviewer 安裝報錯 libQt5WebKit.so.5()(64bit) >= 5.5
ubuntu...... # for DEB packages: apt install ./teamviewer_13.x.yyy_[arch].deb apt install ./teamviewer-host_13.x.yyy_[arch].deb centos...
Linux下啟動rabbitmq報錯:./rabbitmq-server: line 80: erl: command not found的解決辦法
樓主今天在linux下啟動rabbitmq的時候,發生瞭如下圖的錯誤: 網上搜索得到了答案,現在分享給大家: 在linux的/etc/profile環境下新增如下兩行程式碼: #set erlang environment export PATH=$PATH:/usr/loc
Linux下啟動tomcat報錯RROR org.apache.catalina.core.StandardContext- Error starting static Resources java.lang.IllegalArgumentException: Document base /home
部署專案的時候,重啟tomcat,死活起不來,很鬱悶,網上巴拉了半天,結合自己的情況,找到了原因; 錯誤日誌資訊: 2018-12-13 13:52:26,992 [main] INFO org.apache.catalina.core.AprLifecycleListener- The APR
Linux下Shell指令碼實現批量重新命名資料夾,批量重新命名檔案(讓原本繁重的工作變得簡單)
最近接了個專案,具體做什麼都不說了,其中有個工作就是批量更改資料夾,然後批量更改資料夾下的檔名字,一會兒先貼程式碼,再詳細解釋步驟。 下面是我的簡化版的目錄結構,實際上有上百個。 project dir1 dir1.py dir2
linux 下shell指令碼執行多個命令的方法
1.每個命令之間用;隔開 說明:各命令的執行給果,不會影響其它命令的執行。換句話說,各個命令都會執行, 但不保證每個命令都執行成功。 2.每個命令之間用&&隔開說明:若前面的命令執行成功,才會去執行後面的命令。這樣可以保證所有的命令執行完畢後,執行過程都是
shell指令碼報錯
報錯——syntax error near unexpected token 1. 這是因為在Windows中的回車符在Linux中被表示為了 ^M ,使用二進位制模式開啟指令碼: vim -b m
在linux下啟動eclipse報錯
Eclipse: Cannot open display: Eclipse: Cannot open display: Eclipse: An error has occurred. See the log file/opt/modules/eclipse/config
Linux下shell指令碼定時執行
1.啟動crond服務 輸入命令:service crond restart Stopping crond: [ OK ] Starting crond:
linux下shell指令碼中sed命令使用變數
用linpack做測試,寫了一個指令碼, 因為每次可修改的引數寫在了配置檔案裡,所以腳本里用sed命令來修改配置檔案#測試次數echo “Input Number of tests:”read numt#每次測試的資料規模,測試次數有多少次,這裡應該又多少組數字,中間以空格隔
Linux下MySQL 啟動報錯: File './mysql-bin.000013' not found (Errcode: 13)
Linux下安裝初始化完MySQL資料庫之後,啟動資料庫失敗。 報錯如下: [[email protected] mysql]# service mysqld startStarting MySQL... ERROR! The server quit witho
SHELL指令碼報錯:value too great for base (error token is "00000001830")
SHELL指令碼執行到bill_id2=`echo $(($2+2))`報錯:value too great for base (error token is "00000001830"),此時$2的值為00000001830 報錯原因解析: SHELL指令碼中變數以“0”
Linux下編譯caffe報錯catastrophic error: error while writing generated C++ file: No space left on device
catastrophic error: error while writing generated C++ file: No space left on device,但是檢視記憶體和儲存都夠。 解決
Linux下docker CE報錯解決
系統:CentOS Linux release 7.2 (Core) 3.10.0-693.11.6.el7.x86_64 SELinux:關閉 docker版本 # docker --version Docker version 17.12.0-