echo hello; echo hi
Run Code Online (Sandbox Code Playgroud)
在脚本中与此相同:
echo hello
echo hi
Run Code Online (Sandbox Code Playgroud)
我如何对以下可能性做同样的事情?
echo hello && echo hi
echo hello || echo hi
Run Code Online (Sandbox Code Playgroud)
我想我可以这样做:
echo hello && \
echo hi
echo hello || \
echo hi
Run Code Online (Sandbox Code Playgroud)
但这或多或少是在模仿多行脚本
这样做的合适方法是什么?
编辑:我知道 && 和 || 工作,我只是想知道如何在多行脚本中有效地复制它
我无法通过fail2ban来检测失败的apache-auth尝试
过滤器如下所示:
^%(_apache_error_client)s (AH01617: )?user .* authentication failure for "\S*": Password Mismatch$
^%(_apache_error_client)s (AH01618: )?user .* not found(: )?\S*\s*$
Run Code Online (Sandbox Code Playgroud)
以及出现的错误:
[Tue Dec 23 13:41:45.870693 2014] [auth_basic:error] [pid 2818] [client 97.171.82.123:91131] AH01617: user miati: authentication failure for "/test/file.html": Password Mismatch, referer: https://example.org/test/file.html
[Tue Dec 23 13:41:45.870693 2014] [auth_basic:error] [pid 2818] [client 97.171.82.123:91131] AH01617: user miati: authentication failure for "/test/file.html": Password Mismatch, referer: https://example.org/test/file.html
Run Code Online (Sandbox Code Playgroud)
都没有正常工作.我想让他们重新编写,以便他们工作,但我无法弄清楚过滤器是如何工作的,谷歌搜索并没有让我任何地方.大多数指南都认为我理解正则表达式,但我不这样做.
任何人都可以解释(或链接)过滤器中的这些参数是什么意思,所以我可以自己修改它?
我需要检测视频是以纵向还是横向模式录制,然后以脚本方式将它们转换为正确的方向.
if [ "$v_orient" == "landscape" ]
then
ffmpeg -i file.mp4 -vf "transpose=1" file.ogv
else
ffmpeg -i file.mp4 file.ogv
fi
Run Code Online (Sandbox Code Playgroud)
我查看了ffmpeg在线文档并用Google搜索,
我尝试过exiftool
exiftool -Rotation -Rotate file.mp4
Run Code Online (Sandbox Code Playgroud)
但是,对于我拥有的横向和纵向视频,这会输出Rotate:90.
如何在bash中检测视频方向?