锐捷客户端运行出错(已解决)
Tofloor
poster avatar
探索
deepin
2018-05-03 16:55
Author
本帖最后由 china140106 于 2018-5-7 10:02 编辑

系统:最新升级后的deepin15.5

校园网使用有线连接的时候需要使用校园网提供的linux版客户端拨号,一年前使用的时候,还可以使用。
很久不用了,最近使用的时候总是运行出错。

使用如下命令查看帮助的时候
sh rjsupplicant.sh --help
显示出错信息如下
rjsupplicant.sh: 8: rjsupplicant.sh: Bad substitution
经百度和论坛检索,未查到有用信息,不知哪位大侠可以提供一些建议?
##########################################################
rjsupplicant.sh内容如下
#########################################################
#! /bin/bash

curDir=$(cd "$(dirname "$0")"; pwd);
arg="";
until [ $# -eq 0 ]
do
    opt=$1;
    if [ "${opt/ /}" != "$opt" ]; then
        arg="$arg \"$opt\"";
    else
        arg="$arg $opt";
    fi
        shift
done

function is64BIT()
{
    os=$(getconf LONG_BIT);
    if [ $os != "64" ];  then
        return 0;
    fi
    return 1;
}

function main()
{
    is64BIT;   
    if [ $? != "1" ];  then   
        chmod +x $curDir/x86/rjsupplicant 2>&-;
        cd $curDir/x86/
        sh -c "$curDir/x86/rjsupplicant $arg";
    else
        chmod +x $curDir/x64/rjsupplicant 2>&-;
        cd $curDir/x64/
        sh -c "$curDir/x64/rjsupplicant $arg";
    fi   
   
}
main;
exit 0;

Reply Favorite View the author
All Replies
avatar
1***6@qq.com
deepin
2018-05-03 22:53
#1
权限检查一下?
Reply View the author
avatar
152******14
deepin
2018-05-04 00:27
#2

如果是权限  直接进入recover 修复下。
Reply View the author
avatar
探索
deepin
2018-05-04 15:58
#3
谢谢二位大侠的回复,应该不是权限的问题。
文件已经设为可执行文件,命令是用sudo执行的。
Reply View the author
avatar
探索
deepin
2018-05-07 18:01
#4
今天终于发现问题在哪了。
rjsupplicant.sh设为可执行文件后,不能用sh命令执行。去掉sh后就好了。
Reply View the author
avatar
1***6@qq.com
deepin
2018-05-08 01:17
#5
https://bbs.deepin.org/post/155960
今天终于发现问题在哪了。
rjsupplicant.sh设为可执行文件后,不能用sh命令执行。去掉sh后就好了。 ...

不是吧同时脚本执行方式还能这么玩?
用的./xxx.sh??
Reply View the author
avatar
探索
deepin
2018-05-08 23:53
#6
https://bbs.deepin.org/post/155960
不是吧同时脚本执行方式还能这么玩?
用的./xxx.sh??

对,设置为可执行文件后,直接./xxx.sh即可。
至于为什么加上sh命令会出错,现在还没有弄明白。
Reply View the author
avatar
探索
deepin
2018-05-09 15:50
#7
https://bbs.deepin.org/post/155960
不是吧同时脚本执行方式还能这么玩?
用的./xxx.sh??

找到原因了,应该是sh和bash的不兼容导致的。
使用bash命令执行这个文件也可顺利进行。
Reply View the author