尝试了好几遍,仍然不能用简写命令调用matlab,这里把过程记录如下。

(1). 登录 server

[She@She ~]$ ssh shecl@xx.xx.xx.xx
Last login: Mon Aug :: from xx.xx.xx.xx
-bash: module: command not found
-bash: module: command not found
-bash: setenv: command not found
-bash: setenv: command not found
bash: setenv: command not found...

(2). 有关 server 的 shell,环境变量等简单信息

[shecl@ ~]$ echo $
-bash [shecl@ ~]$ pwd
/home/shecl [shecl@ ~]$ echo $PATH
/opt/pgi/linux86-/10.6/bin:/usr/lib64/qt-3.3/bin:/usr/lib64/openmpi/bin/:/usr/lib64/mpich/bin/:/opt/pgi/linux86-/10.6/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/shecl/.local/bin:/home/shecl/bin:/usr/local/MATLAB/R2015b/bin:/usr/local/MATLAB/R2015b/bin/glnxa64 [shecl@ ~]$ which matlab
alias matlab='/usr/local/MATLAB/R2015b/bin/matlab'
/usr/local/MATLAB/R2015b/bin/matlab [shecl@ ~]$ alias
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias matlab='/usr/local/MATLAB/R2015b/bin/matlab'
alias mpirun='mpirun -x LD_PRELOAD=libmpi.so'
alias ncdump='/opt/netcdf/bin/ncdump'
alias opendir='nautilus'
alias openpdf='xdg-open'
alias vi='vim'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

(3). 以简写命令的方式前台调用 matlab,成功。结果如下:

[shecl@192 ~]$ matlab
MATLAB is selecting SOFTWARE OPENGL rendering. < M A T L A B (R) >
Copyright 1984-2015 The MathWorks, Inc.
R2015b (8.6.0.267246) 64-bit (glnxa64)
August 20, 2015 To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com. >> datevec(now) ans = 1.0e+03 * 2.0160 0.0080 0.0150 0.0170 0.0110 0.0030 >> exit

(4). 测试用的 matlab 脚本: script.m

[shecl@ ~]$ cat script.m
disp(['This demo for matlab ',datestr(now,'yyyy-mm-dd HH:MM:SS')]);
disp('Time of 127s pause');
pause();
disp(['Time is out on ',datestr(now,'yyyy-mm-dd HH:MM:SS')]);

(5). 以绝对路径的方式后台调用 matlab,成功。结果如下:

[shecl@ ~]$ nohup /usr/local/MATLAB/R2015b/bin/matlab -nojvm -nodisplay -nosplash -nodesktop < script.m >running.log >running.err &
[] >> [shecl@ ~]$ cat running.log < M A T L A B (R) >
Copyright - The MathWorks, Inc.
R2015b (8.6.0.267246) -bit (glnxa64)
August , For online documentation, see http://www.mathworks.com/support
For product information, visit www.mathworks.com. >> This demo for matlab -- ::
>> Time of 127s pause
>> >> Time is out on -- ::
>> >> []+ Done nohup /usr/local/MATLAB/R2015b/bin/matlab -nojvm -nodisplay -nosplash -nodesktop < script.m > running.log > running.err

(6). 以简写命令的方式后台调用 matlab,失败。结果如下:

[shecl@ ~]$ nohup matlab -nojvm -nodisplay -nosplash -nodesktop < script.m >running.log >running.err &
[]
[shecl@ ~]$ cat running.log matlab: No MATLAB bin directory for this machine architecture. ARCH = glnxa64 []+ Exit nohup matlab -nojvm -nodisplay -nosplash -nodesktop < script.m > running.log > running.err

(7). bug 描述

[shecl@192 ~]$ nohup /usr/local/MATLAB/R2015b/bin/matlab -nojvm -nodisplay -nosplash -nodesktop < script.m 1>running.log 2>running.err &   # 调用成功
[shecl@192 ~]$ nohup matlab                              -nojvm -nodisplay -nosplash -nodesktop < script.m 1>running.log 2>running.err &   # 调用失败

(8). 修复建议,因权限问题,未解决

可以用创建软链接 (ln -s) 的方式修复这个 bug,但是,没有权限来执行该操作。其原因可能是远程登录时限制了权限,需要在主机上操作;也可能是该用户名未分配该权限,需要切换到超级管理员。为安全起见,不建议使用超级管理员远程登录服务器。

[shecl@ ~]$ sudo ln -s /usr/local/MATLAB/R2015b/bin/matlab /usr/local/bin/matlab
[sudo] password for shecl:
Sorry, user shecl is not allowed to execute '/bin/ln -s /usr/local/MATLAB/R2015b/bin/matlab /usr/local/bin/matlab' as root on 192.168.0.45.

记录完毕。

[CentOS Server] Bug when calling matlab in bash的更多相关文章

  1. centOS 6.7 中安装matlab R2014b

    参考资料: [1] http://www.centoscn.com/image-text/config/2014/1222/4354.html 系统: centOS 6.7 2.6.32-573.el ...

  2. How To install FFMPEG, FLVTOOL2, MP4Box on CentOS server 2015 easy method

    for i386:wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpmrpm ...

  3. centos没有service命令的恢复方法(-bash: service: command not found)

    转载自:https://blog.csdn.net/u014175572/article/details/53375049?utm_source=itdadao&utm_medium=refe ...

  4. ubuntu(centos) server安装vmware tools

    Ubuntu: root登录ubutun $ sudo su vmware中选择菜单虚拟机->安装VMware Tools 命令行如下 // 将cdrom挂载到mnt $ mount -t is ...

  5. Calling Matlab function from python: “initializer must be a rectangular nested sequence”

    I am writing a python script from which I hope to call the Matlab anovan function. I have attempted ...

  6. Unable to VNC onto Centos server remotely

    用的好好的vncserver 突然遇到这个错误: [vnc@localhost ~]$ sudo systemctl status vncserver@:1.service -l● vncserver ...

  7. CentOS Bash 命令补全增强软件包 bash-completion

    引言 之前安装的 CentOS 7 是最小化安装,在使用 systemctl 命令进行服务的管理时,经常手动输入相关服务名.如果对一个服务名称不熟悉,这样可以迫使我们记住它,但如果对一个服务名已经很熟 ...

  8. VNC Server Installation on CentOS 6.5

    In my case I have a fresh installed CentOS6.5 Server on which I will be installing the VNC-server so ...

  9. CentOS Linux修改默认Bash shell为Zsh shell

    Shell是在程序员与服务器间建立一个桥梁,它对外提供一系列命令,让我们得以控制服务器.常用的Bash就是Shell的一种,也是Linux下默认Shell程序.这里介绍一种更强大的.更人性化的Shel ...

随机推荐

  1. Mac > MacBook Pro的移动硬盘方案

    灵感来自:http://cone.cc/2012/12/30/Macbook-Air-HD/ 主要为了解决:如果让移动硬盘,无缝地,安全地,同时应用在苹果电脑系统和微软的系统. 除了储存文件,我还想用 ...

  2. angular的$scope

    angularJS是一个MVVM的前端js框架. $scope的作用是angular向视图(html)传递数据的通道,它不负责处理和操作数据.也就是说要想向视图传递数据的话,必须定义$scope变量. ...

  3. 脚本改yum源

  4. 1.NSNotification|远程通知|本地通知|激光推送

    1.   通知在iOS中应用非常广泛,合理的应用通知可以减少冗余代码,使我们的代码层次结构变了更加的清晰明了,利于程序猿读写.它主要分为不可见通知可见通知两种: 1.1 不可见通知,主要是有系统发出的 ...

  5. qt creator 使用Ui文件的问题

    一.显式地调用uic.exe 如何将UI文件生成头文件 1,将设计的UI文件拷贝到uic.exe的目录下Qt\Qt5.3.2\5.3\mingw482_32\bin. 2, 打开windows的CMD ...

  6. 一步一步安装UEFI分区方式的windows 10 企业版

    发现很多坛友不会安装UEFI分区的windows 10 从启动设置,到分区,到最后的引导与激活都是很大的问题. 在我看来这是最不容易出错的安装方式适合于刚刚上手的菜鸟,自己按照图片一步一步的就可以安装 ...

  7. 轻松解决U盘中病毒,文件变成.exe执行文件的问题

    U盘中的文件都变成.exe可执行文件是怎么回事?告诉你,你的U盘中病毒了,那么如何清除呢?小编现在就告诉你几个简单方法,轻松就能搞定U盘中病毒问题. 方法1: (1)首先使用杀毒软件把U盘杀杀毒,除去 ...

  8. Java GUI编程

    ----基础 // 创建一个窗体对象        JFrame frame = new JFrame();        // 设置窗口大小        frame.setSize(300, 20 ...

  9. SQL出错

    2016-12-26 15:43:02,870 DEBUG [org.springframework.test.context.support.DirtiesContextTestExecutionL ...

  10. OpenLayers图形与列表互动

    项目上遇到这样一种需求:查询数据库后得到结果(带地理位置的)列表,每个结果在地图上都是一个四边形,四边形之间有交叉,有重叠,需要实现地图上的四边形和结果列表的互动.抛开其他逻辑功能,互动需求可以表示为 ...