小编Lin*_*00b的帖子

cd 进入一个目录

需要什么权限?我的意思是实际 cd 进入目录所需的最低权限。

这只是我的一个普遍问题。如果某人具有可执行权限,是否足以通过 CD 命令访问目录?谢谢!

permissions

3
推荐指数
1
解决办法
3826
查看次数

通过符号链接调用时 $0 持有什么?

$0外壳参数保存调用程序的名称。如果my_command在主目录中创建一个指向命令的符号链接/usr/local/bin/command1并通过键入 来执行它./my_command,那么 的值是$0多少?任何人都可以解释为什么?谢谢!

linux symlink

2
推荐指数
1
解决办法
663
查看次数

测试一个简单的脚本,但我一直收到第 20 行参数过多的错误

问候 UNIX&Linux 用户。我对我在 bash 脚本中编写的一些代码有疑问。我的程序应该执行以下操作:

编写一个脚本,从用户那里读取两个字符串。该脚本将对两个字符串执行三个操作:

(1) 使用 test 命令查看其中一个字符串的长度是否为零,另一个是否为非零长度,将两个结果都告诉用户。(2) 确定每个字符串的长度并告诉用户哪个更长或者它们是否相等。(3) 比较字符串,看它们是否相同。让用户知道结果。

  6 #(1) Use the test command to see if one of the strings is of zero length and if the other is
  7 #of non-zero length, telling the user of both results.
  8 #(2) Determine the length of each string and tell the user which is longer or if they are of
  9 #equal length.
 10 #(3) Compare the strings to see if they are the same. Let …
Run Code Online (Sandbox Code Playgroud)

bash shell-script

1
推荐指数
1
解决办法
3226
查看次数

脚本中的 Shebang 序列

让我们假设shebang 序列包含在一个单独的文件中编写的脚本中;例如,我创建了一个example.sh脚本文件。

如果我在文件中添加shebang序列:

 #!/bin/sh
Run Code Online (Sandbox Code Playgroud)

我如何确定上面的命令未被识别为注释(在 Linux Bash 脚本中,#通常被视为注释的开始。

shell shebang

0
推荐指数
1
解决办法
200
查看次数

标签 统计

bash ×1

linux ×1

permissions ×1

shebang ×1

shell ×1

shell-script ×1

symlink ×1