【发布时间】:2021-08-01 01:19:43
【问题描述】:
我已经安装了包
p7zip-full
对于 ubuntu,我正在运行以下名为 7z 的 shell 脚本,并放置在与数据集压缩文件相同的目录中
#!bin/sh
mkdir ./min6dB
mkdir ./0dB
mkdir ./6dB
7z -omin6dB -y x ./-6_dB_valve.zip
7z -omin6dB -y x ./-6_dB_pump.zip
数据集文件夹如图所示
我得到下面的错误
Scanning the drive for archives:
ERROR: No more files
虽然这个特定文件存在于我的目录中。 我该如何解决这个问题?
我使用适用于 Windows 10 的 Ubuntu 应用。
【问题讨论】:
-
你的 shebang 应该看起来像这样
#!/bin/sh。 -
@Darkman 我试过它不起作用。好吧,我在 Windows 10 中并使用 Git bash 运行 unix 命令,所以我想为了将存档解压缩到特定目录,我应该使用 7z 脚本中的其他命令
-
不要将您的脚本命名为与 7z 二进制文件相同的名称。可能像
7z.sh这样的东西会更好。 -
我现在使用这个命令
unzip -6_dB_fan.zip -d /min6dB但又得到一个错误-d option used more than once (only one exdir allowed) -
这个怎么样:
unzip -d './min6db' '-6_db_fan.zip'或unzip -d "./min6db" "-6_db_fan.zip"?`(引号,连字符)。
标签: linux bash shell ubuntu scripting