大家好,我对壳不太了解。我需要压缩一些PNG文件,并且在网络上找到了一个bash shell脚本。bash壳通常与tinypng的API一起使用
的API当我运行外壳时,我会收到此错误:
bash:tinypng.sh:找不到命令...
我试图通过这种方法运行它:
tinypng.sh -d [DIRECTORY]/
我也尝试这样做:
bash tinypng.sh -d [DIRECTORY]/
当我运行时,我只是此信息:
名称 tinypng-使用tinypng.com服务收缩PNG。
摘要 tinypng [-dkph] -f文件
描述 使用tinypng.com服务收缩PNG。
在第一次执行或if/directory/directory/.tinypng.apikey中不存在, tinypng会要求一个API键。
从https://tinypng.com/developers获取API密钥,复制和 提示时将其粘贴。
选项
-f,--file FILE Select a FILE to be shrinked.
-d,--download DIRECTORY Download all shrinked PNGs to DIRECTORY.
-k,--key API_KEY Use API_KEY, instead of the one stored in /DIRECTORY/DIRECTORY/.tinypng.apikey. -p,--print When -d is being used, the URLs of the shrinked PNGs are not being printed to stdout. Use this option to force printing even when using -d.
Otherwise, this option is set implicitly.
-- FILES Ignore any options to come.
Everything after this option is considered a file.
-h,--help Show this message and exit successfully.
EXAMPLES
Shrink foo.png, bar.png, baz.png and print the result URLs to stdout.
$ tinypng -f foo.png -f bar.png -f baz.png
or
$ tinypng -- foo.png bar.png baz.png
Shrink foo.png, bar.png, baz.png and download the result PNGs to tiny_pngs/ directory
$ tinypng -d tiny_pngs/ -- foo.png bar.png baz.png
由Rany Albeg Wein撰写-Rany.albeg@gmail.com
tinypng --help
显示您的解决方案:
tinypng -d tiny_pngs/ -- foo.jpg bar.png baz.png
将缩小foo.jpg,bar.png,baz.png,然后下载缩小的文件到tiny_pngs/directory。