bash: ./hello: 权限不够

sh/bash/dash/ksh/zsh等Shell脚本
回复
晓~~
帖子: 2
注册时间: 2011-03-18 21:02

bash: ./hello: 权限不够

#1

帖子 晓~~ » 2011-03-18 21:09

请教各位大侠:

最简单的helloworld的程序
但是提示bash: ./hello: 权限不够!!!
求教~~
头像
飞火流星
帖子: 990
注册时间: 2010-05-11 21:50

Re: bash: ./hello: 权限不够

#2

帖子 飞火流星 » 2011-03-18 21:38

不就是运行个程序么?权限不够就加sudo
有事多折腾。。。没事瞎折腾。。。
本本
acer 4745g i5-430 4G ATI5650 1G 独显 500G硬盘
台台
赛扬coppermine 1.0GHz 160MB内存 集成显声卡 网卡一块。
archlinux+xfce无压力
flac
帖子: 408
注册时间: 2009-05-29 15:21

Re: bash: ./hello: 权限不够

#3

帖子 flac » 2011-03-18 21:40


chmod +x hello
头像
zhw2101024
帖子: 1849
注册时间: 2009-03-28 16:10
系统: Arch debian win7
联系:

Re: bash: ./hello: 权限不够

#4

帖子 zhw2101024 » 2011-03-18 22:08

如果你安装之后没有改root账户密码,直接进入桌面,那就是权限问题了,试试sudo ./hello。现在的ubuntu版本要改root密码才能进入root,那样不加sudo也不会报错了。sudo可以暂时给普通用户一部分管理员的权限,用来安装软件什么的,需要输入当前用户的密码。建议看看论坛里的新手帖,有事没事多Google。
头像
HelloAndroid
帖子: 156
注册时间: 2010-10-17 18:23

Re: bash: ./hello: 权限不够

#5

帖子 HelloAndroid » 2011-03-18 22:23

chmod u+x helloworld
用起来还是蛮舒服的!
生命在于折腾!
为什么这个论坛复旦的人很少!!
wxd2000
帖子: 6
注册时间: 2010-06-07 13:00
来自: su zhou/ jiang su
联系:

Re: bash: ./hello: 权限不够

#6

帖子 wxd2000 » 2011-03-27 11:40

chmod 777 helloworld
due to you are in usr mod , so this chmod order can change the file attribute to rwx
rwx rwx rwx = 111 111 111
rw- rw- rw- = 110 110 110
rwx --- --- = 111 000 000

and so on...

rwx = 111 in binary = 7
rw- = 110 in binary = 6
r-x = 101 in binary = 5
r-- = 100 in binary = 4
头像
tenzu
论坛版主
帖子: 36924
注册时间: 2008-11-21 20:26

Re: bash: ./hello: 权限不够

#7

帖子 tenzu » 2011-03-27 12:04

又是权限。。。
zhonghp
帖子: 3
注册时间: 2011-04-18 21:30

Re: bash: ./hello: 权限不够

#8

帖子 zhonghp » 2011-04-18 21:32

还是权限不够啊。。。求解释
头像
lilydjwg
论坛版主
帖子: 4249
注册时间: 2009-04-11 23:46
系统: Arch Linux
联系:

Re: bash: ./hello: 权限不够

#9

帖子 lilydjwg » 2011-04-18 22:16

是不是文件格式不对?file 它看看输出。
arthurchen
帖子: 8
注册时间: 2011-04-07 21:47

Re: bash: ./hello: 权限不够

#10

帖子 arthurchen » 2011-04-19 22:37

maybe due to some extended ext filesytem attributes, you'd better check the file properties
pangding
帖子: 48
注册时间: 2011-03-01 23:14

Re: bash: ./hello: 权限不够

#11

帖子 pangding » 2011-04-30 19:35

我觉得就是加个
chmod +x hello
的事
头像
alan8410
帖子: 32
注册时间: 2008-11-28 12:12

Re: bash: ./hello: 权限不够

#12

帖子 alan8410 » 2011-05-02 21:26

谁都知道权限不够时加 sudo, 或chmod

但这次不一样,试试 :
~ bash hello.sh

就是在ubuntu下脚本不能直接执行,要加 bash *.sh
自由自在,无拘无束 ...
回复