Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 为什么shell/bash命令在googlecollaboratory中表现出奇怪的行为?_Linux_Bash_Shell_Google Colaboratory - Fatal编程技术网

Linux 为什么shell/bash命令在googlecollaboratory中表现出奇怪的行为?

Linux 为什么shell/bash命令在googlecollaboratory中表现出奇怪的行为?,linux,bash,shell,google-colaboratory,Linux,Bash,Shell,Google Colaboratory,我在Google Collab笔记本中使用了一组bash shell和Python3 shell。 通常,bash脚本和shell命令按如下方式执行: !wget“somelink” 但我注意到,有时更改目录指令!cd/内容/ 通常似乎有效,但在大多数情况下,有时需要%cd/content/ 我似乎不知道为什么会这样。我不能提供一个可复制的示例,但可以说这个问题是在运行shell脚本(扩展名为.sh的文件)之后发生的 另一个奇怪的行为是:当我运行bash脚本时,它通常可以按的方式完成!sh但是

我在Google Collab笔记本中使用了一组bash shell和Python3 shell。 通常,bash脚本和shell命令按如下方式执行:

!wget“somelink”
但我注意到,有时更改目录指令
!cd/内容/
通常似乎有效,但在大多数情况下,有时需要
%cd/content/
我似乎不知道为什么会这样。我不能提供一个可复制的示例,但可以说这个问题是在运行shell脚本(扩展名为
.sh
的文件)之后发生的

另一个奇怪的行为是:当我运行bash脚本时,它通常可以按
的方式完成!sh
但是当我编辑脚本或试图替换它时,我得到了

/bin/bash: script.sh: Permission denied
虽然这个答案帮助我通过使用
!bash script.sh


我如何理解这种行为?

脚本不可执行?这是所有类unix系统afaik上都会出现的错误。我想知道Collab背后的原因,因为它在所有Linux系统中都很常见。顺便说一句,Google Collab也在Ubuntu后端工作。