作者flied (libertines)
标题Re: [问题] 安装软体的路径错误
时间Sun Jan 26 21:40:43 2014
※ 引述《soem (流水)》之铭言:
: ※ 引述《flied (libertines)》之铭言:
: : lee@lee-X402CA:~$ which talys
: : /usr/bin/talys
: 这应该就是可以直接call得到talys指令了
: 这是之前的文章
: : lee@lee-X402CA:~/physics/talys/samples$ ./verify
: : bash: ./verify: 拒绝不符权限的操作
: 这是後来你执行的状况
: : lee@lee-X402CA:/bin$ chmod +x verify
: : chmod: 无法存取 ‘verify’: 没有此一档案或目录
: : lee@lee-X402CA:/bin$ ./verify
: : bash: ./verify: 没有此一档案或目录
: 请注意你现在的所在目录,
: 比对两次结果,你是不是该去 ~/physics/talys/samples 寻找你的verify
: 虽然不知道为甚麽你会在/bin里面,姑且推论一下你的想法好了:
: 1. 你可能认为执行档要在/bin底下才能跑?
: => 实际上不用,跟档案权限有关系
: 但要注意的是,如果你要执行的不是在系统$PATH里面的程式,
: 要用相对或绝对路径的方式去呼叫。
: 像是你在 ~/physics/talys/samples里面呼叫相对路径 "./":
: ~/physics/talys/samples$ ./verify
: 或是绝对路径
: /home/你的帐号/physics/talys/samples/verify
: 若是你直接呼叫verify,就是呼叫到系统预先有的那只verify工具。
: 2. 你可能不确定chmod的功能以及"bash: ./verify: 拒绝不符权限的操作"的成因
: => 首先无论是script或程式一般来说都需要档案权限才能执行;
: 这边的权现有两个面向:你的权限,和设定给档案的权限。
: 我们先来看看一般权限的呈现方式:
: $ ls -ld /bin/bash
: -rwxr-xr-x 1 root root 959120 Mar 29 2013 /bin/bash
: 第一组rwx是这个档案的拥有者root所能做的事情
: read, write, execute
: 第二组rwx是这个档案的拥有者群组,root群组所能做的事情
: 所以有在root群组且非使用者root则会参考这组设定
: 第三组rwx则是除此以外的人的权限。
: 所以说,我们可以看到/bin/bash这个档案,
: - 拥有者root具有所有权限;
: - 拥有者群组root没有修改(写入)的权限,但可以读取和执行;
: - 剩下的人亦是没有修改、有读取执行的权限。
: 一般的文字档案类型往往是644,例如:
: $ ls -ld /etc/hosts
: -rw-r--r-- 1 root root 342 Jan 22 20:16 /etc/hosts
: 我想你的~/physics/talys/samples/verify应该也是类似的情形,
: 因此你需要的是帮他加上execute
: ~/physics/talys/samples/$ chmod +x verify
: sudo 可以帮你取得不同使用者的权限,但针对x这项设定通常需要用chmod来调整。
谢谢
我执行了这行成功
lee@lee-X402CA:~/physics/talys/samples$ ./verify
bash: ./verify: 拒绝不符权限的操作
lee@lee-X402CA:~/physics/talys/samples$ chmod +x verify
lee@lee-X402CA:~/physics/talys/samples$ ./verify
/home/lee/physics/talys/samples/17/a/new
/home/lee/physics/talys/samples/17/b/new
/home/lee/physics/talys/samples/17/c/new
/home/lee/physics/talys/samples/11/new
/home/lee/physics/talys/samples/10/a/new
/home/lee/physics/talys/samples/10/b/new
/home/lee/physics/talys/samples/20/new
/home/lee/physics/talys/samples/1/f/new
/home/lee/physics/talys/samples/1/g/new
/home/lee/physics/talys/samples/1/e/new
/home/lee/physics/talys/samples/1/h/new
/home/lee/physics/talys/samples/1/a/new
/home/lee/physics/talys/samples/1/b/new
/home/lee/physics/talys/samples/1/d/new
/home/lee/physics/talys/samples/1/i/new
/home/lee/physics/talys/samples/1/c/new
/home/lee/physics/talys/samples/8/new
/home/lee/physics/talys/samples/21/new
/home/lee/physics/talys/samples/3/a/new
/home/lee/physics/talys/samples/3/b/new
/home/lee/physics/talys/samples/3/d/new
/home/lee/physics/talys/samples/3/c/new
/home/lee/physics/talys/samples/22/new
/home/lee/physics/talys/samples/9/new
/home/lee/physics/talys/samples/6/a/new
/home/lee/physics/talys/samples/6/b/new
/home/lee/physics/talys/samples/19/new
/home/lee/physics/talys/samples/16/a/new
/home/lee/physics/talys/samples/16/b/new
/home/lee/physics/talys/samples/16/d/new
/home/lee/physics/talys/samples/16/c/new
/home/lee/physics/talys/samples/2/new
/home/lee/physics/talys/samples/24/new
/home/lee/physics/talys/samples/25/new
/home/lee/physics/talys/samples/12/new
/home/lee/physics/talys/samples/23/new
/home/lee/physics/talys/samples/14/new
/home/lee/physics/talys/samples/5/new
/home/lee/physics/talys/samples/15/new
/home/lee/physics/talys/samples/18/a/new
/home/lee/physics/talys/samples/18/b/new
/home/lee/physics/talys/samples/4/a/new
/home/lee/physics/talys/samples/4/b/new
/home/lee/physics/talys/samples/13/new
/home/lee/physics/talys/samples/7/new
似乎成功
但readme如下
Verification
------------
- cd samples
- verify
Under Linux/Unix, this should run all sample cases (about 1 hour on
a fast PC).
我这大概3秒就结束
所以应该还没有装好
: : lee@lee-X402CA:/bin$ verify
: : Verify CIE values, Version 1.4.0
: 这边就只是你的系统有安装一个叫做verify的指令,
: 但这你的使用经验看来,那个指令并不是你这次安装的步骤中需要呼叫到的。
Your own calculations
---------------------
- talys < input > output
where you can make your own input file starting from the many sample cases
we provide.
我试着计算执行
错误如下
lee@lee-X402CA:~/physics/talys/test$ talys input output5
TALYS-error: Structure database not installed: change path in machine.f
我的machine.f 在 /home/lee/physics/talys/source
https://www.dropbox.com/s/zmbhzustk6hnp6v/2014-01-26%2021%3A39%3A35.png
内容如下
https://www.dropbox.com/s/yq6o4hbraqftuf6/2014-01-26%2021%3A32%3A21.png
c ********************* Set directory for structure data ***************
c
c path : directory containing structure files to be read
c lenpath: length of pathname
c
c The maximum length of the path is 60 characters
c
home='/home/lee/physics/talys/' (我改这行)
lenhome=0
do 10 i=1,60
if (home(i:i).eq.' ') goto 100
lenhome=lenhome+1
10 continue
100 path=home(1:lenhome)//'structure/'
lenpath=lenhome+10
c
c Test to check accessibility of structure files
c
inquire (file=path(1:lenpath)//'abundance/z001',exist=lexist)
if (lexist) return
write(*,'(" TALYS-error: Structure database not installed:",
+ " change path in machine.f")')
stop
end
Copyright (C) 2013 A.J. Koning, S. Hilaire and S. Goriely
我改的只有这部份
原本是 home='.'
不能执行後,我改成
home='/home/lee/physics/talys/'
这样改对吧?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 101.3.47.52