如何从任何文件夹启动shell脚本?

时间:2018-03-29 19:44:14

标签: linux shell ubuntu zsh

我正在运行Ubuntu 16.04。与ZSH 所以我在〜/ bin 中创建了一个文件 test ,其中包含以下内容:

i

授予权限并使其可执行:

'Counts Cells
i = 5
j = 9

'Sum Product cell
sum = 0
sum2 = 0

'counts number of the brand
ct1 = 1
ct2 = 1

Do While sh1.Cells(i, j).Value <> "" 'cell need not be blank
  sh2.Cells(1, 3).Value = i
  sh2.Cells(1, 4).Value = sum
  sh2.Cells(1, 5).Value = sum2

  If sh1.Cells(i, j).Value = sh2.Cells(9, 5).Value Then 'cells(9,5) is brand 1
    sum = sum + sh1.Cells(i, j + 2).Value
    ct1 = ct1 + 1
  End If

  If sh1.Cells(i, j).Value = sh2.Cells(9, 6).Value Then 'Cells(9,6) is brand 2
    sum2 = sum2 + sh1.Cells(i, j).Value
    ct2 = ct2 + 1
  End If

  i = i + 1
Loop

sh2.Cells(10, 5).Value = sum / ct1
sh2.Cells(10, 6).Value = sum2 / ct2

之后,我已将〜/ bin 添加到路径

#!/bin/sh
echo "Hello";

现在我正在尝试从chmod x=xrw test 执行脚本,但似乎我做错了什么,因为它什么也没做。

enter image description here

有什么想法吗?

0 个答案:

没有答案