- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
Ubuntu 18.04 - 从 here 安装 Zsh 和 Oh-My-Zsh .
鉴于以下
echo '#!/bin/bash\n\nls ~;' >> myscript.sh
chmod 755 ./myscript.sh
./myscript.sh
在我的主文件夹中执行,一切按预期进行,它列出了我的主文件夹中的文件
output omitted for brevity -- it worked and listed files as the script intended
在辅助驱动器中执行我得到下面列出的输出(我的 fstab 配置在这个问题中列在下面)。
╭─user@host /media/user/raw/scripts
╰─$ echo '#!/bin/bash\n\nls ~;' >> myscript.sh
╭─user@host /media/user/raw/scripts
╰─$ chmod 755 ./myscript.sh
╭─user@host /media/user/raw/scripts
╰─$ ./myscript.sh
zsh: permission denied: ./myscript.sh
我的/etc/fstab
╭─user@host /media/user/raw/scripts
╰─$ cat /etc/fstab 130 ↵
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb2 during installation
UUID=<<some_uuid>> / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sdb1 during installation
UUID=<<some_uuid>> /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
/dev/disk/by-uuid/<<some_uuid>> /media/user/raw auto user,rw,nofail,x-gvfs-show 0 0
因为这在我的主文件夹中执行正常,而不是在这个安装的驱动器上,我认为问题出在 fstab 配置中的某个地方。有什么想法吗?
最佳答案
您隐式指定了 noexec
,这意味着设备上的任何文件都不可执行。
这是man mount
:
user
Allow an ordinary user to mount the filesystem. The name of the mounting user is written to the mtab file (or to the private libmount file in /run/mount on systems without a regular mtab) so that this same user can unmount the filesystem again. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid).
同一段落还建议修复:使用 user,exec
重新启用用户可挂载 fs 中的执行。
关于linux - 无法从安装的磁盘执行 .sh 脚本 (Ubuntu 18.04) : zsh: permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51234334/
我正在尝试在 Macos big sur 上执行 .zsh 脚本,但它不允许我这样做。 每当我在终端中运行 .zsh 时,它会显示“/bin/zsh:无法打开输入文件:file-name.zsh” 我
在此示例中,我尝试将所有值从一个关联数组复制到另一个关联数组。我正在使用 zsh -n 检查我的代码是否存在语法错误,但是这个会抛出一个 test:12: bar: assignment to inv
我想获取$*的最后一个元素。到目前为止,我发现的最好的是: last=`eval "echo \\\$$#"` 但这似乎太不透明了。 最佳答案 在zsh中,您可以使用P parameter expa
有没有办法做type of auto-suggestion Fish does在 Zsh 中? 最佳答案 https://github.com/tarruda/zsh-autosuggestions正
我希望通过为 dtach 创建一个 zsh 别名来加快我的工作流程,其功能如下: dtach -A /tmp/{directoryName} -r winch dvtm 我尝试过这样做,但不起作用。
我已经安装了 NVM,然后我发现了 oh-my-zsh 并安装了它。它似乎有一个 nvm 插件,我在 .zshrc 中启用了它。 我还将其放入我的 .zprofile export NVM_DIR="
每当我运行 bower install或任何 bower命令,它最终运行为 bundle install或来自 bundler 的其他内容.我正在使用 oh-my-zsh 运行 zsh shell。它
如果在 bash 我做(从命令行) echo $0 输出是 bash 和其他 shell 类似。 但是如果我在 中做同样的事情zsh 输出是 -zsh 为什么zsh前面有那个破折号? 最佳答案 she
关于bower.io有一条警告说: Warning On prezto or oh-my-zsh, do not forget to alias bower='noglob bower' or bow
我想为接受目录作为参数的命令编写自定义补全。我认为通过示例来解释它应该如何工作是最简单的。 假设我在某处定义了一个目录列表: d=(~/somedir/foo ~/somedir/foo/bar ~/
我正在尝试构建一个 zsh 函数,该函数根据时间间隔返回输出。最初“你渴了”条件为真,但在通过命令行更改变量 thirsty 并将其设置为 false 后,初始 if 语句通过,但变量 thirsty
如果在 Zsh 中(在 macOS 或 Ubuntu 上)连续运行以下命令: date +%s echo \ a\ b\ c 然后可以按 5 次向上箭头滚动回到第一个命令。 有没有一种方法可以通过两次
在常规数组中,我可以使用 (i) 或 (I) 来搜索与给定值匹配的条目的索引(从头开始的第一个匹配项或数组的末尾,分别): list=(foo bar baz) echo $list[(i)bar]
我是 zsh 的新手。 我可以输入类似 cd %wiki 的内容吗?跳转到 ~/prj/golang/gowiki如果它是独一无二的。 但是,如果 cd %unix 可能有两个以上的目录, 只显示匹配
我尝试了无数方法来获得我想要的东西,但似乎没有任何效果。我总是得到类似 2:not found 的结果. 我想捕获命令的输出,然后测试它是否等于“!”,如下所示: function test() {
我在我的 mac 上使用 zsh (oh-my-zsh),我不明白为什么在我的输出结束时总是有这个字符:“%” 如果我不把 export TERM="xterm-256color"放在我的 ~/.zs
给定一个 Zsh 数组 myarray,我可以把它作为一个子集数组 set -A subarray for el in $myarray do if [[ $el =~ *x*y* ]] th
有时候我们在终端运行一个命令,输出太大了,忘了把“|less”放在最后。所以我想知道当输出在 zsh 中太大时是否可以分页? 我尝试使用 python 和 less 来实现这个功能: #!/usr/b
我有一个设置,我很高兴在机器之间共享我的配置文件,但我发现我经常想在 zsh (Ctrl + R) 中搜索,我不记得我在哪台机器上输入了命令。理想情况下,我希望从我的任何机器中搜索以前命令的规范重复列
如何根据现有的完成定义和默认参数为函数设置完成。 一个简化的例子(可以改写为别名): gpl() { git pull origin $@ } 这应该与 git pull origin 之后的
我是一名优秀的程序员,十分优秀!